<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class DEBUGGER__::ThreadClient - debug: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="Color.html">DEBUGGER__::Color</a>
    <li><a class="include" href="SkipPathHelper.html">DEBUGGER__::SkipPathHelper</a>
    <li><a class="include" href="GlobalVariablesHelper.html">DEBUGGER__::GlobalVariablesHelper</a>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-current">::current</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-3C-3C">#&lt;&lt;</a>
    <li ><a href="#method-i-assemble_arguments">#assemble_arguments</a>
    <li ><a href="#method-i-class_method_map">#class_method_map</a>
    <li ><a href="#method-i-close">#close</a>
    <li ><a href="#method-i-collect_locals">#collect_locals</a>
    <li ><a href="#method-i-constant_name-3F">#constant_name?</a>
    <li ><a href="#method-i-current_frame">#current_frame</a>
    <li ><a href="#method-i-dap_eval">#dap_eval</a>
    <li ><a href="#method-i-deactivate">#deactivate</a>
    <li ><a href="#method-i-debug_cmd">#debug_cmd</a>
    <li ><a href="#method-i-debug_event">#debug_event</a>
    <li ><a href="#method-i-debug_mode">#debug_mode</a>
    <li ><a href="#method-i-debug_suspend">#debug_suspend</a>
    <li ><a href="#method-i-default_frame_formatter">#default_frame_formatter</a>
    <li ><a href="#method-i-evaluate_result">#evaluate_result</a>
    <li ><a href="#method-i-event-21">#event!</a>
    <li ><a href="#method-i-exceptionDetails">#exceptionDetails</a>
    <li ><a href="#method-i-frame_eval">#frame_eval</a>
    <li ><a href="#method-i-frame_eval_core">#frame_eval_core</a>
    <li ><a href="#method-i-frame_str">#frame_str</a>
    <li ><a href="#method-i-generate_info">#generate_info</a>
    <li ><a href="#method-i-get_consts">#get_consts</a>
    <li ><a href="#method-i-get_frame">#get_frame</a>
    <li ><a href="#method-i-get_src">#get_src</a>
    <li ><a href="#method-i-inspect">#inspect</a>
    <li ><a href="#method-i-internalProperty">#internalProperty</a>
    <li ><a href="#method-i-iter_consts">#iter_consts</a>
    <li ><a href="#method-i-location">#location</a>
    <li ><a href="#method-i-make_breakpoint">#make_breakpoint</a>
    <li ><a href="#method-i-management-3F">#management?</a>
    <li ><a href="#method-i-mark_as_management">#mark_as_management</a>
    <li ><a href="#method-i-name">#name</a>
    <li ><a href="#method-i-on_breakpoint">#on_breakpoint</a>
    <li ><a href="#method-i-on_init">#on_init</a>
    <li ><a href="#method-i-on_load">#on_load</a>
    <li ><a href="#method-i-on_pause">#on_pause</a>
    <li ><a href="#method-i-on_trace">#on_trace</a>
    <li ><a href="#method-i-on_trap">#on_trap</a>
    <li ><a href="#method-i-outline_method">#outline_method</a>
    <li ><a href="#method-i-preview">#preview</a>
    <li ><a href="#method-i-preview_">#preview_</a>
    <li ><a href="#method-i-process_cdp">#process_cdp</a>
    <li ><a href="#method-i-process_dap">#process_dap</a>
    <li ><a href="#method-i-propertyDescriptor">#propertyDescriptor</a>
    <li ><a href="#method-i-propertyDescriptor_">#propertyDescriptor_</a>
    <li ><a href="#method-i-puts">#puts</a>
    <li ><a href="#method-i-puts_variable_info">#puts_variable_info</a>
    <li ><a href="#method-i-replay_suspend">#replay_suspend</a>
    <li ><a href="#method-i-running-3F">#running?</a>
    <li ><a href="#method-i-search_const">#search_const</a>
    <li ><a href="#method-i-set_mode">#set_mode</a>
    <li ><a href="#method-i-show_by_editor">#show_by_editor</a>
    <li ><a href="#method-i-show_consts">#show_consts</a>
    <li ><a href="#method-i-show_frame">#show_frame</a>
    <li ><a href="#method-i-show_frames">#show_frames</a>
    <li ><a href="#method-i-show_globals">#show_globals</a>
    <li ><a href="#method-i-show_ivars">#show_ivars</a>
    <li ><a href="#method-i-show_locals">#show_locals</a>
    <li ><a href="#method-i-show_outline">#show_outline</a>
    <li ><a href="#method-i-show_src">#show_src</a>
    <li ><a href="#method-i-special_local_variables">#special_local_variables</a>
    <li ><a href="#method-i-step_tp">#step_tp</a>
    <li ><a href="#method-i-suspend">#suspend</a>
    <li ><a href="#method-i-to_s">#to_s</a>
    <li ><a href="#method-i-tp_allow_reentry">#tp_allow_reentry</a>
    <li ><a href="#method-i-truncate">#truncate</a>
    <li ><a href="#method-i-type_name">#type_name</a>
    <li ><a href="#method-i-value_inspect">#value_inspect</a>
    <li ><a href="#method-i-variable">#variable</a>
    <li ><a href="#method-i-variable_">#variable_</a>
    <li ><a href="#method-i-wait_next_action">#wait_next_action</a>
    <li ><a href="#method-i-wait_next_action_">#wait_next_action_</a>
    <li ><a href="#method-i-wait_reply">#wait_reply</a>
    <li ><a href="#method-i-waiting-3F">#waiting?</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-DEBUGGER__::ThreadClient">
    <h1 id="class-DEBUGGER__::ThreadClient" class="class">
      class DEBUGGER__::ThreadClient
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="MAX_LENGTH">MAX_LENGTH
          <dd>
          <dt id="SPECIAL_LOCAL_VARS">SPECIAL_LOCAL_VARS
          <dd>
          <dt id="SUPPORT_TARGET_THREAD">SUPPORT_TARGET_THREAD
          <dd>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-check_bp_fulfillment_map" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">check_bp_fulfillment_map</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-id" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">id</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-recorder" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">recorder</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-thread" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">thread</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-current" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">current</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="current-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 50</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">current</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">thc</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-value">:DEBUGGER__ThreadClient</span>]
    <span class="ruby-identifier">thc</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">thc</span> = <span class="ruby-constant">SESSION</span>.<span class="ruby-identifier">get_thread_client</span>
    <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-value">:DEBUGGER__ThreadClient</span>] = <span class="ruby-identifier">thc</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(id, q_evt, q_cmd, thr = Thread.current)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 112</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span> <span class="ruby-identifier">id</span>, <span class="ruby-identifier">q_evt</span>, <span class="ruby-identifier">q_cmd</span>, <span class="ruby-identifier">thr</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>
  <span class="ruby-ivar">@is_management</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@id</span> = <span class="ruby-identifier">id</span>
  <span class="ruby-ivar">@thread</span> = <span class="ruby-identifier">thr</span>
  <span class="ruby-ivar">@target_frames</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@q_evt</span> = <span class="ruby-identifier">q_evt</span>
  <span class="ruby-ivar">@q_cmd</span> = <span class="ruby-identifier">q_cmd</span>
  <span class="ruby-ivar">@step_tp</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@output</span> = []
  <span class="ruby-ivar">@frame_formatter</span> = <span class="ruby-identifier">method</span>(<span class="ruby-value">:default_frame_formatter</span>)
  <span class="ruby-ivar">@var_map</span> = {} <span class="ruby-comment"># { thread_local_var_id =&gt; obj } for DAP</span>
  <span class="ruby-ivar">@obj_map</span> = {} <span class="ruby-comment"># { object_id =&gt; obj } for CDP</span>
  <span class="ruby-ivar">@recorder</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@mode</span> = <span class="ruby-value">:waiting</span>
  <span class="ruby-ivar">@current_frame_index</span> = <span class="ruby-value">0</span>
  <span class="ruby-comment"># every thread should maintain its own CheckBreakpoint fulfillment state</span>
  <span class="ruby-ivar">@check_bp_fulfillment_map</span> = {} <span class="ruby-comment"># { check_bp =&gt; boolean }</span>
  <span class="ruby-identifier">set_mode</span> <span class="ruby-value">:running</span>
  <span class="ruby-identifier">thr</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value">:@__thread_client_id</span>, <span class="ruby-identifier">id</span>)

  <span class="ruby-operator">::</span><span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;Thread \##{@id} is created.&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-3C-3C" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">&lt;&lt;</span><span
                                class="method-args">(req)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="3C-3C-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 211</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">&lt;&lt;</span> <span class="ruby-identifier">req</span>
  <span class="ruby-identifier">debug_cmd</span>(<span class="ruby-identifier">req</span>)
  <span class="ruby-ivar">@q_cmd</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">req</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-assemble_arguments" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">assemble_arguments</span><span
                                class="method-args">(args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="assemble_arguments-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 69</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">assemble_arguments</span>(<span class="ruby-identifier">args</span>)
  <span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-node">&quot;#{colorize_cyan(arg[:name])}=#{arg[:value]}&quot;</span>
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;, &quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-class_method_map" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">class_method_map</span><span
                                class="method-args">(classes)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="class_method_map-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 797</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">class_method_map</span>(<span class="ruby-identifier">classes</span>)
  <span class="ruby-identifier">dumped</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mod</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-constant">Object</span> }.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">methods</span> = <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">public_instance_methods</span>(<span class="ruby-keyword">false</span>).<span class="ruby-identifier">select</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">dumped</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">m</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">dumped</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">m</span>)
    <span class="ruby-keyword">end</span>
    [<span class="ruby-identifier">mod</span>, <span class="ruby-identifier">methods</span>]
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">reverse</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-close" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">close</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="close-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 179</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">close</span>
  <span class="ruby-ivar">@q_cmd</span>.<span class="ruby-identifier">close</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-collect_locals" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">collect_locals</span><span
                                class="method-args">(frame)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="collect_locals-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 549</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">collect_locals</span>(<span class="ruby-identifier">frame</span>)
  <span class="ruby-identifier">locals</span> = []

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">s</span> = <span class="ruby-identifier">frame</span>&amp;.<span class="ruby-identifier">self</span>
    <span class="ruby-identifier">locals</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-string">&quot;%self&quot;</span>, <span class="ruby-identifier">s</span>]
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">special_local_variables</span> <span class="ruby-identifier">frame</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">locals</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">name</span>, <span class="ruby-identifier">val</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">vars</span> = <span class="ruby-identifier">frame</span>&amp;.<span class="ruby-identifier">local_variables</span>
    <span class="ruby-identifier">vars</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">var</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">locals</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">var</span>, <span class="ruby-identifier">val</span>]
    }
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">locals</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-constant_name-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">constant_name?</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>TODO: support non-ASCII Constant name</p>

                              <div class="method-source-code" id="constant_name-3F-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 810</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">constant_name?</span> <span class="ruby-identifier">name</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">name</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A::\b/</span>
    <span class="ruby-identifier">constant_name?</span> <span class="ruby-identifier">$~</span>.<span class="ruby-identifier">post_match</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A[A-Z]\w*/</span>
    <span class="ruby-identifier">post</span> = <span class="ruby-identifier">$~</span>.<span class="ruby-identifier">post_match</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">post</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">constant_name?</span> <span class="ruby-identifier">post</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-current_frame" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">current_frame</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="current_frame-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 537</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_frame</span>
  <span class="ruby-identifier">get_frame</span>(<span class="ruby-ivar">@current_frame_index</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-dap_eval" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">dap_eval</span><span
                                class="method-args">(b, expr, _context, prompt: &#39;(repl_eval)&#39;)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="dap_eval-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_dap.rb, line 789</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">dap_eval</span> <span class="ruby-identifier">b</span>, <span class="ruby-identifier">expr</span>, <span class="ruby-identifier">_context</span>, <span class="ruby-value">prompt:</span> <span class="ruby-string">&#39;(repl_eval)&#39;</span>
  <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">b</span>.<span class="ruby-identifier">eval</span>(<span class="ruby-identifier">expr</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">prompt</span>)
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
    <span class="ruby-identifier">e</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-deactivate" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">deactivate</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="deactivate-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 135</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">deactivate</span>
  <span class="ruby-ivar">@step_tp</span>.<span class="ruby-identifier">disable</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@step_tp</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-debug_cmd" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">debug_cmd</span><span
                                class="method-args">(cmds)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="debug_cmd-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 1270</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">debug_cmd</span>(<span class="ruby-identifier">cmds</span>)
  <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{
    <span class="ruby-identifier">cmd</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">cmds</span>
    <span class="ruby-identifier">args</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span> <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">safe_inspect</span>(<span class="ruby-identifier">arg</span>) }
    <span class="ruby-node">&quot;#{inspect} receives Cmd { type: #{cmd.inspect}, args: #{args} } from Session&quot;</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-debug_event" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">debug_event</span><span
                                class="method-args">(ev, args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="debug_event-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 1257</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">debug_event</span>(<span class="ruby-identifier">ev</span>, <span class="ruby-identifier">args</span>)
  <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{
    <span class="ruby-identifier">args</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span> <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">safe_inspect</span>(<span class="ruby-identifier">arg</span>) }
    <span class="ruby-node">&quot;#{inspect} sends Event { type: #{ev.inspect}, args: #{args} } to Session&quot;</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-debug_mode" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">debug_mode</span><span
                                class="method-args">(old_mode, new_mode)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="debug_mode-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 1264</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">debug_mode</span>(<span class="ruby-identifier">old_mode</span>, <span class="ruby-identifier">new_mode</span>)
  <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{
    <span class="ruby-node">&quot;#{inspect} changes mode (#{old_mode} -&gt; #{new_mode})&quot;</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-debug_suspend" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">debug_suspend</span><span
                                class="method-args">(event)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="debug_suspend-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 1278</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">debug_suspend</span>(<span class="ruby-identifier">event</span>)
  <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{
    <span class="ruby-node">&quot;#{inspect} is suspended for #{event.inspect}&quot;</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-default_frame_formatter" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">default_frame_formatter</span><span
                                class="method-args">(frame)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="default_frame_formatter-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 75</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_frame_formatter</span> <span class="ruby-identifier">frame</span>
  <span class="ruby-identifier">call_identifier_str</span> =
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">frame_type</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:block</span>
      <span class="ruby-identifier">level</span>, <span class="ruby-identifier">block_loc</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">block_identifier</span>
      <span class="ruby-identifier">args</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">parameters_info</span>

      <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>
        <span class="ruby-identifier">args_str</span> = <span class="ruby-node">&quot; {|#{assemble_arguments(args)}|}&quot;</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-node">&quot;#{colorize_blue(&quot;block&quot;)}#{args_str} in #{colorize_blue(block_loc + level)}&quot;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:method</span>
      <span class="ruby-identifier">ci</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">method_identifier</span>
      <span class="ruby-identifier">args</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">parameters_info</span>

      <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>
        <span class="ruby-identifier">args_str</span> = <span class="ruby-node">&quot;(#{assemble_arguments(args)})&quot;</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-node">&quot;#{colorize_blue(ci)}#{args_str}&quot;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:c</span>
      <span class="ruby-identifier">colorize_blue</span>(<span class="ruby-identifier">frame</span>.<span class="ruby-identifier">c_identifier</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-value">:other</span>
      <span class="ruby-identifier">colorize_blue</span>(<span class="ruby-identifier">frame</span>.<span class="ruby-identifier">other_identifier</span>)
    <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">location_str</span> = <span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location_str</span>, [<span class="ruby-value">:GREEN</span>])
  <span class="ruby-identifier">result</span> = <span class="ruby-node">&quot;#{call_identifier_str} at #{location_str}&quot;</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">return_str</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">return_str</span>
    <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; #=&gt; #{colorize_magenta(return_str)}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">result</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-evaluate_result" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">evaluate_result</span><span
                                class="method-args">(r)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="evaluate_result-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 1217</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">evaluate_result</span> <span class="ruby-identifier">r</span>
  <span class="ruby-identifier">v</span> = <span class="ruby-identifier">variable</span> <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">r</span>
  <span class="ruby-identifier">v</span>[<span class="ruby-value">:value</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-event-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">event!</span><span
                                class="method-args">(ev, *args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="event-21-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 222</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">event!</span> <span class="ruby-identifier">ev</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
  <span class="ruby-identifier">debug_event</span>(<span class="ruby-identifier">ev</span>, <span class="ruby-identifier">args</span>)
  <span class="ruby-ivar">@q_evt</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-keyword">self</span>, <span class="ruby-ivar">@output</span>, <span class="ruby-identifier">ev</span>, <span class="ruby-identifier">generate_info</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>]
  <span class="ruby-ivar">@output</span> = []
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-exceptionDetails" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">exceptionDetails</span><span
                                class="method-args">(exc, text)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="exceptionDetails-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 1165</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">exceptionDetails</span> <span class="ruby-identifier">exc</span>, <span class="ruby-identifier">text</span>
  <span class="ruby-identifier">frames</span> = [
    {
      <span class="ruby-value">columnNumber:</span> <span class="ruby-value">0</span>,
      <span class="ruby-value">functionName:</span> <span class="ruby-string">&#39;eval&#39;</span>,
      <span class="ruby-value">lineNumber:</span> <span class="ruby-value">0</span>,
      <span class="ruby-value">url:</span> <span class="ruby-string">&#39;&#39;</span>
    }
  ]
  <span class="ruby-identifier">exc</span>.<span class="ruby-identifier">backtrace_locations</span>&amp;.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">loc</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">loc</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">__FILE__</span>
    <span class="ruby-identifier">path</span> = <span class="ruby-identifier">loc</span>.<span class="ruby-identifier">absolute_path</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">loc</span>.<span class="ruby-identifier">path</span>
    <span class="ruby-identifier">frames</span> <span class="ruby-operator">&lt;&lt;</span> {
      <span class="ruby-value">columnNumber:</span> <span class="ruby-value">0</span>,
      <span class="ruby-value">functionName:</span> <span class="ruby-identifier">loc</span>.<span class="ruby-identifier">base_label</span>,
      <span class="ruby-value">lineNumber:</span> <span class="ruby-identifier">loc</span>.<span class="ruby-identifier">lineno</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>,
      <span class="ruby-value">url:</span> <span class="ruby-identifier">path</span>
    }
  <span class="ruby-keyword">end</span>
  {
    <span class="ruby-value">exceptionId:</span> <span class="ruby-value">1</span>,
    <span class="ruby-value">text:</span> <span class="ruby-identifier">text</span>,
    <span class="ruby-value">lineNumber:</span> <span class="ruby-value">0</span>,
    <span class="ruby-value">columnNumber:</span> <span class="ruby-value">0</span>,
    <span class="ruby-value">exception:</span> <span class="ruby-identifier">evaluate_result</span>(<span class="ruby-identifier">exc</span>),
    <span class="ruby-value">stackTrace:</span> {
      <span class="ruby-value">callFrames:</span> <span class="ruby-identifier">frames</span>
    }
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-frame_eval" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">frame_eval</span><span
                                class="method-args">(src, re_raise: false, binding_location: false) { |e| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="frame_eval-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 436</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">frame_eval</span> <span class="ruby-identifier">src</span>, <span class="ruby-value">re_raise:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">binding_location:</span> <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@success_last_eval</span> = <span class="ruby-keyword">false</span>

  <span class="ruby-identifier">b</span> = <span class="ruby-identifier">current_frame</span>&amp;.<span class="ruby-identifier">eval_binding</span> <span class="ruby-operator">||</span> <span class="ruby-constant">TOPLEVEL_BINDING</span>

  <span class="ruby-identifier">special_local_variables</span> <span class="ruby-identifier">current_frame</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">var</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">b</span>.<span class="ruby-identifier">local_variable_set</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">var</span>) <span class="ruby-keyword">if</span> <span class="ruby-regexp">/\%/</span> <span class="ruby-operator">!~</span> <span class="ruby-identifier">name</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">result</span> = <span class="ruby-identifier">frame_eval_core</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">b</span>, <span class="ruby-value">binding_location:</span> <span class="ruby-identifier">binding_location</span>)

  <span class="ruby-ivar">@success_last_eval</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-identifier">result</span>

<span class="ruby-keyword">rescue</span> <span class="ruby-constant">SystemExit</span>
  <span class="ruby-identifier">raise</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">yield</span>(<span class="ruby-identifier">e</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>

  <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;eval error: #{e}&quot;</span>

  <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace_locations</span>&amp;.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">loc</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">loc</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">__FILE__</span>
    <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;  #{loc}&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">re_raise</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-frame_eval_core" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">frame_eval_core</span><span
                                class="method-args">(src, b, binding_location: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="frame_eval_core-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 405</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">frame_eval_core</span> <span class="ruby-identifier">src</span>, <span class="ruby-identifier">b</span>, <span class="ruby-value">binding_location:</span> <span class="ruby-keyword">false</span>
  <span class="ruby-identifier">saved_target_frames</span> = <span class="ruby-ivar">@target_frames</span>
  <span class="ruby-identifier">saved_current_frame_index</span> = <span class="ruby-ivar">@current_frame_index</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">b</span>
    <span class="ruby-identifier">file</span>, <span class="ruby-identifier">lineno</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">source_location</span>

    <span class="ruby-identifier">tp_allow_reentry</span> <span class="ruby-keyword">do</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">binding_location</span>
        <span class="ruby-identifier">b</span>.<span class="ruby-identifier">eval</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">lineno</span>)
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">b</span>.<span class="ruby-identifier">eval</span>(<span class="ruby-identifier">src</span>, <span class="ruby-node">&quot;(rdbg)/#{file}&quot;</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">frame_self</span> = <span class="ruby-identifier">current_frame</span>.<span class="ruby-identifier">self</span>

    <span class="ruby-identifier">tp_allow_reentry</span> <span class="ruby-keyword">do</span>
      <span class="ruby-identifier">frame_self</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-identifier">src</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@target_frames</span> = <span class="ruby-identifier">saved_target_frames</span>
  <span class="ruby-ivar">@current_frame_index</span> = <span class="ruby-identifier">saved_current_frame_index</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-frame_str" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">frame_str</span><span
                                class="method-args">(i, frame: @target_frames[i])</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="frame_str-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 753</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">frame_str</span>(<span class="ruby-identifier">i</span>, <span class="ruby-value">frame:</span> <span class="ruby-ivar">@target_frames</span>[<span class="ruby-identifier">i</span>])
  <span class="ruby-identifier">cur_str</span> = (<span class="ruby-ivar">@current_frame_index</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">?</span> <span class="ruby-string">&#39;=&gt;&#39;</span> <span class="ruby-operator">:</span> <span class="ruby-string">&#39;  &#39;</span>)
  <span class="ruby-identifier">prefix</span> = <span class="ruby-node">&quot;#{cur_str}##{i}&quot;</span>
  <span class="ruby-identifier">frame_string</span> = <span class="ruby-ivar">@frame_formatter</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">frame</span>)
  <span class="ruby-node">&quot;#{prefix}\t#{frame_string}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-generate_info" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">generate_info</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="generate_info-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 216</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">generate_info</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">current_frame</span>

  { <span class="ruby-value">location:</span> <span class="ruby-identifier">current_frame</span>.<span class="ruby-identifier">location_str</span>, <span class="ruby-value">line:</span> <span class="ruby-identifier">current_frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">lineno</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-get_consts" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">get_consts</span><span
                                class="method-args">(expr = nil, only_self: false, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="get_consts-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 613</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_consts</span> <span class="ruby-identifier">expr</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-value">only_self:</span> <span class="ruby-keyword">false</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">expr</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">expr</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">_self</span> = <span class="ruby-identifier">frame_eval</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-value">re_raise:</span> <span class="ruby-keyword">true</span>)
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
      <span class="ruby-comment"># ignore</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">if</span> <span class="ruby-constant">M_KIND_OF_P</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">_self</span>, <span class="ruby-constant">Module</span>)
        <span class="ruby-identifier">iter_consts</span> <span class="ruby-identifier">_self</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
        <span class="ruby-keyword">return</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{_self.inspect} (by #{expr}) is not a Module.&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">_self</span> = <span class="ruby-identifier">current_frame</span>&amp;.<span class="ruby-identifier">self</span>
    <span class="ruby-identifier">cs</span> = {}
    <span class="ruby-keyword">if</span> <span class="ruby-constant">M_KIND_OF_P</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">_self</span>, <span class="ruby-constant">Module</span>)
      <span class="ruby-identifier">cs</span>[<span class="ruby-identifier">_self</span>] = <span class="ruby-value">:self</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">_self</span> = <span class="ruby-constant">M_CLASS</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">_self</span>)
      <span class="ruby-identifier">cs</span>[<span class="ruby-identifier">_self</span>] = <span class="ruby-value">:self</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">only_self</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">only_self</span>
      <span class="ruby-identifier">_self</span>.<span class="ruby-identifier">ancestors</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Object</span>; <span class="ruby-identifier">cs</span>[<span class="ruby-identifier">c</span>] = <span class="ruby-value">:ancestors</span>}
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">b</span> = <span class="ruby-identifier">current_frame</span>&amp;.<span class="ruby-identifier">binding</span>
        <span class="ruby-identifier">b</span>.<span class="ruby-identifier">eval</span>(<span class="ruby-string">&#39;::Module.nesting&#39;</span>).<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cs</span>[<span class="ruby-identifier">c</span>] = <span class="ruby-value">:nesting</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">cs</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">c</span>}
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">names</span> = {}

    <span class="ruby-identifier">cs</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">iter_consts</span> <span class="ruby-identifier">c</span>, <span class="ruby-identifier">names</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
    }
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-get_frame" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">get_frame</span><span
                                class="method-args">(index)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="get_frame-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 541</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_frame</span>(<span class="ruby-identifier">index</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@target_frames</span>
    <span class="ruby-ivar">@target_frames</span>[<span class="ruby-identifier">index</span>]
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-get_src" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">get_src</span><span
                                class="method-args">(frame, max_lines:, start_line: nil, end_line: nil, dir: +1)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="get_src-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 464</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_src</span>(<span class="ruby-identifier">frame</span>,
            <span class="ruby-value">max_lines:</span>,
            <span class="ruby-value">start_line:</span> <span class="ruby-keyword">nil</span>,
            <span class="ruby-value">end_line:</span> <span class="ruby-keyword">nil</span>,
            <span class="ruby-value">dir:</span> <span class="ruby-value">+1</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">file_lines</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">file_lines</span>
    <span class="ruby-identifier">frame_line</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">lineno</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>

    <span class="ruby-keyword">if</span> <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:no_lineno</span>]
      <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">file_lines</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">file_lines</span>.<span class="ruby-identifier">map</span>.<span class="ruby-identifier">with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">cur</span> = <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">frame_line</span> <span class="ruby-operator">?</span> <span class="ruby-string">&#39;=&gt;&#39;</span> <span class="ruby-operator">:</span> <span class="ruby-string">&#39;  &#39;</span>
        <span class="ruby-identifier">line</span> = <span class="ruby-identifier">colorize_dim</span>(<span class="ruby-string">&#39;%4d|&#39;</span> <span class="ruby-operator">%</span> (<span class="ruby-identifier">i</span><span class="ruby-value">+1</span>))
        <span class="ruby-node">&quot;#{cur}#{line} #{e}&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">start_line</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">show_line</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">dir</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
          <span class="ruby-identifier">start_line</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">show_line</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">end_line</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">show_line</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">max_lines</span>
          <span class="ruby-identifier">start_line</span> = [<span class="ruby-identifier">end_line</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">max_lines</span>, <span class="ruby-value">0</span>].<span class="ruby-identifier">max</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">start_line</span> = [<span class="ruby-identifier">frame_line</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">max_lines</span><span class="ruby-operator">/</span><span class="ruby-value">2</span>, <span class="ruby-value">0</span>].<span class="ruby-identifier">max</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">end_line</span>
      <span class="ruby-identifier">end_line</span> = [<span class="ruby-identifier">start_line</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">max_lines</span>, <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">size</span>].<span class="ruby-identifier">min</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">start_line</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">end_line</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">max_lines</span>
      [<span class="ruby-identifier">start_line</span>, <span class="ruby-identifier">end_line</span>, <span class="ruby-identifier">lines</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span> <span class="ruby-comment"># no file lines</span>
    <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-identifier">p</span> <span class="ruby-identifier">e</span>
  <span class="ruby-identifier">pp</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>
  <span class="ruby-identifier">exit!</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-inspect" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">inspect</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="inspect-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 183</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inspect</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">bt</span> = <span class="ruby-ivar">@thread</span>.<span class="ruby-identifier">backtrace</span>
    <span class="ruby-node">&quot;#&lt;DBG:TC #{self.id}:#{@mode}@#{bt[-1]}&gt;&quot;</span>
  <span class="ruby-keyword">else</span> <span class="ruby-comment"># bt can be nil</span>
    <span class="ruby-node">&quot;#&lt;DBG:TC #{self.id}:#{@mode}&gt;&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-internalProperty" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">internalProperty</span><span
                                class="method-args">(name, obj)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="internalProperty-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 1222</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">internalProperty</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>
  <span class="ruby-identifier">v</span> = <span class="ruby-identifier">variable</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>
  <span class="ruby-identifier">v</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value">:configurable</span>
  <span class="ruby-identifier">v</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value">:enumerable</span>
  <span class="ruby-identifier">v</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-iter_consts" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">iter_consts</span><span
                                class="method-args">(c, names = {}) { |name, value| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="iter_consts-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 600</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">iter_consts</span> <span class="ruby-identifier">c</span>, <span class="ruby-identifier">names</span> = {}
  <span class="ruby-identifier">c</span>.<span class="ruby-identifier">constants</span>(<span class="ruby-keyword">false</span>).<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">names</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">name</span>
    <span class="ruby-identifier">names</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">value</span> = <span class="ruby-identifier">c</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">name</span>)
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
      <span class="ruby-identifier">value</span> = <span class="ruby-identifier">e</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">yield</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-location" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">location</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="location-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 65</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">location</span>
  <span class="ruby-identifier">current_frame</span>&amp;.<span class="ruby-identifier">location</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-make_breakpoint" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">make_breakpoint</span><span
                                class="method-args">(args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="make_breakpoint-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 826</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">make_breakpoint</span> <span class="ruby-identifier">args</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:method</span>
    <span class="ruby-identifier">klass_name</span>, <span class="ruby-identifier">op</span>, <span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">cond</span>, <span class="ruby-identifier">cmd</span>, <span class="ruby-identifier">path</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span>]
    <span class="ruby-identifier">bp</span> = <span class="ruby-constant">MethodBreakpoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">current_frame</span>&amp;.<span class="ruby-identifier">eval_binding</span> <span class="ruby-operator">||</span> <span class="ruby-constant">TOPLEVEL_BINDING</span>, <span class="ruby-identifier">klass_name</span>, <span class="ruby-identifier">op</span>, <span class="ruby-identifier">method_name</span>, <span class="ruby-value">cond:</span> <span class="ruby-identifier">cond</span>, <span class="ruby-value">command:</span> <span class="ruby-identifier">cmd</span>, <span class="ruby-value">path:</span> <span class="ruby-identifier">path</span>)
    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">enable</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">NameError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">klass</span>
        <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Unknown method name: \&quot;#{e.name}\&quot;&quot;</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-comment"># klass_name can not be evaluated</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">constant_name?</span> <span class="ruby-identifier">klass_name</span>
          <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Unknown constant name: \&quot;#{e.name}\&quot;&quot;</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-comment"># only Class name is allowed</span>
          <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Not a constant name: \&quot;#{klass_name}\&quot;&quot;</span>
          <span class="ruby-identifier">bp</span> = <span class="ruby-keyword">nil</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-constant">Session</span>.<span class="ruby-identifier">activate_method_added_trackers</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">bp</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">inspect</span>
      <span class="ruby-identifier">bp</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">bp</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:watch</span>
    <span class="ruby-identifier">ivar</span>, <span class="ruby-identifier">object</span>, <span class="ruby-identifier">result</span>, <span class="ruby-identifier">cond</span>, <span class="ruby-identifier">command</span>, <span class="ruby-identifier">path</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span>]
    <span class="ruby-constant">WatchIVarBreakpoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ivar</span>, <span class="ruby-identifier">object</span>, <span class="ruby-identifier">result</span>, <span class="ruby-value">cond:</span> <span class="ruby-identifier">cond</span>, <span class="ruby-value">command:</span> <span class="ruby-identifier">command</span>, <span class="ruby-value">path:</span> <span class="ruby-identifier">path</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unknown breakpoint: #{args}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-management-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">management?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="management-3F-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 139</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">management?</span>
  <span class="ruby-ivar">@is_management</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-mark_as_management" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">mark_as_management</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="mark_as_management-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 143</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">mark_as_management</span>
  <span class="ruby-ivar">@is_management</span> = <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">name</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="name-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 175</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">name</span>
  <span class="ruby-node">&quot;##{@id} #{@thread.name || @thread.backtrace.last}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-on_breakpoint" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">on_breakpoint</span><span
                                class="method-args">(tp, bp)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="on_breakpoint-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 251</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">on_breakpoint</span> <span class="ruby-identifier">tp</span>, <span class="ruby-identifier">bp</span>
  <span class="ruby-identifier">suspend</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">event</span>, <span class="ruby-identifier">tp</span>, <span class="ruby-value">bp:</span> <span class="ruby-identifier">bp</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-on_init" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">on_init</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="on_init-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 243</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">on_init</span> <span class="ruby-identifier">name</span>
  <span class="ruby-identifier">wait_reply</span> [<span class="ruby-value">:init</span>, <span class="ruby-identifier">name</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-on_load" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">on_load</span><span
                                class="method-args">(iseq, eval_src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="on_load-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 239</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">on_load</span> <span class="ruby-identifier">iseq</span>, <span class="ruby-identifier">eval_src</span>
  <span class="ruby-identifier">wait_reply</span> [<span class="ruby-value">:load</span>, <span class="ruby-identifier">iseq</span>, <span class="ruby-identifier">eval_src</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-on_pause" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">on_pause</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="on_pause-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 263</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">on_pause</span>
  <span class="ruby-identifier">suspend</span> <span class="ruby-value">:pause</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-on_trace" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">on_trace</span><span
                                class="method-args">(trace_id, msg)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="on_trace-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 247</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">on_trace</span> <span class="ruby-identifier">trace_id</span>, <span class="ruby-identifier">msg</span>
  <span class="ruby-identifier">wait_reply</span> [<span class="ruby-value">:trace</span>, <span class="ruby-identifier">trace_id</span>, <span class="ruby-identifier">msg</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-on_trap" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">on_trap</span><span
                                class="method-args">(sig)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="on_trap-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 255</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">on_trap</span> <span class="ruby-identifier">sig</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">waiting?</span>
    <span class="ruby-comment"># raise Interrupt</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">suspend</span> <span class="ruby-value">:trap</span>, <span class="ruby-value">sig:</span> <span class="ruby-identifier">sig</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-outline_method" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">outline_method</span><span
                                class="method-args">(o, klass, obj)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="outline_method-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 783</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">outline_method</span>(<span class="ruby-identifier">o</span>, <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">obj</span>)
  <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">singleton_class</span> = <span class="ruby-constant">M_SINGLETON_CLASS</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>)
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">TypeError</span>
    <span class="ruby-identifier">singleton_class</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">maps</span> = <span class="ruby-identifier">class_method_map</span>((<span class="ruby-identifier">singleton_class</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">klass</span>).<span class="ruby-identifier">ancestors</span>)
  <span class="ruby-identifier">maps</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span>, <span class="ruby-identifier">methods</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">name</span> = <span class="ruby-identifier">mod</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">singleton_class</span> <span class="ruby-operator">?</span> <span class="ruby-node">&quot;#{klass}.methods&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{mod}#methods&quot;</span>
    <span class="ruby-identifier">o</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">methods</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-preview" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">preview</span><span
                                class="method-args">(name, obj)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="preview-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 1297</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">preview</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">obj</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Array</span>
    <span class="ruby-identifier">pd</span> = <span class="ruby-identifier">propertyDescriptor</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>
    <span class="ruby-identifier">overflow</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">100</span>
      <span class="ruby-identifier">obj</span> = <span class="ruby-identifier">obj</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">99</span>]
      <span class="ruby-identifier">overflow</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">hash</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">each_with_index</span>.<span class="ruby-identifier">to_h</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">o</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">o</span>]}
    <span class="ruby-identifier">preview_</span> <span class="ruby-identifier">pd</span>[<span class="ruby-value">:value</span>], <span class="ruby-identifier">hash</span>, <span class="ruby-identifier">overflow</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Hash</span>
    <span class="ruby-identifier">pd</span> = <span class="ruby-identifier">propertyDescriptor</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>
    <span class="ruby-identifier">overflow</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">100</span>
      <span class="ruby-identifier">obj</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">to_a</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">99</span>].<span class="ruby-identifier">to_h</span>
      <span class="ruby-identifier">overflow</span> = <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">preview_</span> <span class="ruby-identifier">pd</span>[<span class="ruby-value">:value</span>], <span class="ruby-identifier">obj</span>, <span class="ruby-identifier">overflow</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-preview_" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">preview_</span><span
                                class="method-args">(value, hash, overflow)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="preview_-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 1254</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">preview_</span> <span class="ruby-identifier">value</span>, <span class="ruby-identifier">hash</span>, <span class="ruby-identifier">overflow</span>
  <span class="ruby-comment"># The reason for not using &quot;map&quot; method is to prevent the object overriding it from causing bugs.</span>
  <span class="ruby-comment"># https://github.com/ruby/debug/issues/781</span>
  <span class="ruby-identifier">props</span> = []
  <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">pd</span> = <span class="ruby-identifier">propertyDescriptor</span> <span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>
    <span class="ruby-identifier">props</span> <span class="ruby-operator">&lt;&lt;</span> {
      <span class="ruby-value">name:</span> <span class="ruby-identifier">pd</span>[<span class="ruby-value">:name</span>],
      <span class="ruby-value">type:</span> <span class="ruby-identifier">pd</span>[<span class="ruby-value">:value</span>][<span class="ruby-value">:type</span>],
      <span class="ruby-value">value:</span> <span class="ruby-identifier">pd</span>[<span class="ruby-value">:value</span>][<span class="ruby-value">:description</span>]
    }
  }
  {
    <span class="ruby-value">type:</span> <span class="ruby-identifier">value</span>[<span class="ruby-value">:type</span>],
    <span class="ruby-value">subtype:</span> <span class="ruby-identifier">value</span>[<span class="ruby-value">:subtype</span>],
    <span class="ruby-value">description:</span> <span class="ruby-identifier">value</span>[<span class="ruby-value">:description</span>],
    <span class="ruby-value">overflow:</span> <span class="ruby-identifier">overflow</span>,
    <span class="ruby-value">properties:</span> <span class="ruby-identifier">props</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-process_cdp" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">process_cdp</span><span
                                class="method-args">(args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="process_cdp-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 962</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process_cdp</span> <span class="ruby-identifier">args</span>
  <span class="ruby-identifier">type</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
  <span class="ruby-identifier">req</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:backtrace</span>
    <span class="ruby-identifier">exception</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">result</span> = {
      <span class="ruby-value">reason:</span> <span class="ruby-string">&#39;other&#39;</span>,
      <span class="ruby-value">callFrames:</span> <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">map</span>.<span class="ruby-identifier">with_index</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">frame</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">exception</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">raised_exception</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">frame</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">current_frame</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">has_raised_exception</span>

        <span class="ruby-identifier">path</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">realpath</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">path</span>

        <span class="ruby-keyword">if</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">nil?</span>
          <span class="ruby-identifier">lineno</span> = <span class="ruby-value">0</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">lineno</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">first_line</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
        <span class="ruby-keyword">end</span>

        {
          <span class="ruby-value">callFrameId:</span> <span class="ruby-constant">SecureRandom</span>.<span class="ruby-identifier">hex</span>(<span class="ruby-value">16</span>),
          <span class="ruby-value">functionName:</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">name</span>,
          <span class="ruby-value">functionLocation:</span> {
            <span class="ruby-comment"># scriptId: N, # filled by SESSION</span>
            <span class="ruby-value">lineNumber:</span> <span class="ruby-identifier">lineno</span>
          },
          <span class="ruby-value">location:</span> {
            <span class="ruby-comment"># scriptId: N, # filled by SESSION</span>
            <span class="ruby-value">lineNumber:</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">lineno</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> <span class="ruby-comment"># The line number is 0-based.</span>
          },
          <span class="ruby-value">url:</span> <span class="ruby-identifier">path</span>,
          <span class="ruby-value">scopeChain:</span> [
            {
              <span class="ruby-value">type:</span> <span class="ruby-string">&#39;local&#39;</span>,
              <span class="ruby-value">object:</span> {
                <span class="ruby-value">type:</span> <span class="ruby-string">&#39;object&#39;</span>,
                <span class="ruby-value">objectId:</span> <span class="ruby-identifier">rand</span>.<span class="ruby-identifier">to_s</span>
              }
            },
            {
              <span class="ruby-value">type:</span> <span class="ruby-string">&#39;script&#39;</span>,
              <span class="ruby-value">object:</span> {
                <span class="ruby-value">type:</span> <span class="ruby-string">&#39;object&#39;</span>,
                <span class="ruby-value">objectId:</span> <span class="ruby-identifier">rand</span>.<span class="ruby-identifier">to_s</span>
              }
            },
            {
              <span class="ruby-value">type:</span> <span class="ruby-string">&#39;global&#39;</span>,
              <span class="ruby-value">object:</span> {
                <span class="ruby-value">type:</span> <span class="ruby-string">&#39;object&#39;</span>,
                <span class="ruby-value">objectId:</span> <span class="ruby-identifier">rand</span>.<span class="ruby-identifier">to_s</span>
              }
            }
          ],
          <span class="ruby-value">this:</span> {
            <span class="ruby-value">type:</span> <span class="ruby-string">&#39;object&#39;</span>
          }
        }
      }
    }

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">exception</span>
      <span class="ruby-identifier">result</span>[<span class="ruby-value">:data</span>] = <span class="ruby-identifier">evaluate_result</span> <span class="ruby-identifier">exception</span>
      <span class="ruby-identifier">result</span>[<span class="ruby-value">:reason</span>] = <span class="ruby-string">&#39;exception&#39;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">event!</span> <span class="ruby-value">:protocol_result</span>, <span class="ruby-value">:backtrace</span>, <span class="ruby-identifier">req</span>, <span class="ruby-identifier">result</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:evaluate</span>
    <span class="ruby-identifier">res</span> = {}
    <span class="ruby-identifier">fid</span>, <span class="ruby-identifier">expr</span>, <span class="ruby-identifier">group</span> = <span class="ruby-identifier">args</span>
    <span class="ruby-identifier">frame</span> = <span class="ruby-ivar">@target_frames</span>[<span class="ruby-identifier">fid</span>]
    <span class="ruby-identifier">message</span> = <span class="ruby-keyword">nil</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">frame</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">b</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">eval_binding</span>)
      <span class="ruby-identifier">special_local_variables</span> <span class="ruby-identifier">frame</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">var</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">b</span>.<span class="ruby-identifier">local_variable_set</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">var</span>) <span class="ruby-keyword">if</span> <span class="ruby-regexp">/\%/</span> <span class="ruby-operator">!~</span><span class="ruby-identifier">name</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-identifier">result</span> = <span class="ruby-keyword">nil</span>

      <span class="ruby-keyword">case</span> <span class="ruby-identifier">group</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;popover&#39;</span>
        <span class="ruby-keyword">case</span> <span class="ruby-identifier">expr</span>
        <span class="ruby-comment"># Chrome doesn&#39;t read instance variables</span>
        <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A\$\S/</span>
          <span class="ruby-identifier">safe_global_variables</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">gvar</span><span class="ruby-operator">|</span>
            <span class="ruby-keyword">if</span> <span class="ruby-identifier">gvar</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">expr</span>
              <span class="ruby-identifier">result</span> = <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">gvar</span>.<span class="ruby-identifier">to_s</span>)
              <span class="ruby-keyword">break</span> <span class="ruby-keyword">false</span>
            <span class="ruby-keyword">end</span>
          } <span class="ruby-keyword">and</span> (<span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Error: Not defined global variable: #{expr.inspect}&quot;</span>)
        <span class="ruby-keyword">when</span> <span class="ruby-regexp">/(\A((::[A-Z]|[A-Z])\w*)+)/</span>
          <span class="ruby-keyword">unless</span> <span class="ruby-identifier">result</span> = <span class="ruby-identifier">search_const</span>(<span class="ruby-identifier">b</span>, <span class="ruby-node">$1</span>)
            <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Error: Not defined constant: #{expr.inspect}&quot;</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-keyword">begin</span>
            <span class="ruby-identifier">result</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">local_variable_get</span>(<span class="ruby-identifier">expr</span>)
          <span class="ruby-keyword">rescue</span> <span class="ruby-constant">NameError</span>
            <span class="ruby-comment"># try to check method</span>
            <span class="ruby-keyword">if</span> <span class="ruby-constant">M_RESPOND_TO_P</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">b</span>.<span class="ruby-identifier">receiver</span>, <span class="ruby-identifier">expr</span>, <span class="ruby-value">include_all:</span> <span class="ruby-keyword">true</span>)
              <span class="ruby-identifier">result</span> = <span class="ruby-constant">M_METHOD</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">b</span>.<span class="ruby-identifier">receiver</span>, <span class="ruby-identifier">expr</span>)
            <span class="ruby-keyword">else</span>
              <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Error: Can not evaluate: #{expr.inspect}&quot;</span>
            <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;console&#39;</span>, <span class="ruby-string">&#39;watch-group&#39;</span>
        <span class="ruby-keyword">begin</span>
          <span class="ruby-identifier">orig_stdout</span> = <span class="ruby-identifier">$stdout</span>
          <span class="ruby-identifier">$stdout</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
          <span class="ruby-identifier">result</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">eval</span>(<span class="ruby-identifier">expr</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-string">&#39;(DEBUG CONSOLE)&#39;</span>)
        <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
          <span class="ruby-identifier">result</span> = <span class="ruby-identifier">e</span>
          <span class="ruby-identifier">res</span>[<span class="ruby-value">:exceptionDetails</span>] = <span class="ruby-identifier">exceptionDetails</span>(<span class="ruby-identifier">e</span>, <span class="ruby-string">&#39;Uncaught&#39;</span>)
        <span class="ruby-keyword">ensure</span>
          <span class="ruby-identifier">output</span> = <span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">string</span>
          <span class="ruby-identifier">$stdout</span> = <span class="ruby-identifier">orig_stdout</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Error: unknown objectGroup: #{group}&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">result</span> = <span class="ruby-constant">Exception</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;Error: Can not evaluate on this frame&quot;</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">res</span>[<span class="ruby-value">:result</span>] = <span class="ruby-identifier">evaluate_result</span>(<span class="ruby-identifier">result</span>)
    <span class="ruby-identifier">event!</span> <span class="ruby-value">:protocol_result</span>, <span class="ruby-value">:evaluate</span>, <span class="ruby-identifier">req</span>, <span class="ruby-value">message:</span> <span class="ruby-identifier">message</span>, <span class="ruby-value">response:</span> <span class="ruby-identifier">res</span>, <span class="ruby-value">output:</span> <span class="ruby-identifier">output</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:scope</span>
    <span class="ruby-identifier">fid</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
    <span class="ruby-identifier">frame</span> = <span class="ruby-ivar">@target_frames</span>[<span class="ruby-identifier">fid</span>]
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">b</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">binding</span>
      <span class="ruby-identifier">vars</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">local_variables</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">v</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">local_variable_get</span>(<span class="ruby-identifier">name</span>)
        <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">v</span>)
      }
      <span class="ruby-identifier">special_local_variables</span> <span class="ruby-identifier">frame</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">vars</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">val</span>)
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">vars</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">variable</span>(<span class="ruby-string">&#39;%self&#39;</span>, <span class="ruby-identifier">b</span>.<span class="ruby-identifier">receiver</span>)
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">lvars</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">local_variables</span>
      <span class="ruby-identifier">vars</span> = <span class="ruby-identifier">lvars</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">var</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">var</span>, <span class="ruby-identifier">val</span>)
      }
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">vars</span> = [<span class="ruby-identifier">variable</span>(<span class="ruby-string">&#39;%self&#39;</span>, <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">self</span>)]
      <span class="ruby-identifier">special_local_variables</span> <span class="ruby-identifier">frame</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">vars</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">val</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">event!</span> <span class="ruby-value">:protocol_result</span>, <span class="ruby-value">:scope</span>, <span class="ruby-identifier">req</span>, <span class="ruby-identifier">vars</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:properties</span>
    <span class="ruby-identifier">oid</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
    <span class="ruby-identifier">result</span> = []
    <span class="ruby-identifier">prop</span> = []

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">obj</span> = <span class="ruby-ivar">@obj_map</span>[<span class="ruby-identifier">oid</span>]
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">obj</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">Array</span>
        <span class="ruby-identifier">result</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">map</span>.<span class="ruby-identifier">with_index</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">o</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">variable</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">o</span>
        }
      <span class="ruby-keyword">when</span> <span class="ruby-constant">Hash</span>
        <span class="ruby-identifier">result</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>)
        }
      <span class="ruby-keyword">when</span> <span class="ruby-constant">Struct</span>
        <span class="ruby-identifier">result</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">members</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">m</span>, <span class="ruby-identifier">obj</span>[<span class="ruby-identifier">m</span>])
        }
      <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
        <span class="ruby-identifier">prop</span> = [
          <span class="ruby-identifier">internalProperty</span>(<span class="ruby-string">&#39;#length&#39;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">length</span>),
          <span class="ruby-identifier">internalProperty</span>(<span class="ruby-string">&#39;#encoding&#39;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">encoding</span>)
        ]
      <span class="ruby-keyword">when</span> <span class="ruby-constant">Class</span>, <span class="ruby-constant">Module</span>
        <span class="ruby-identifier">result</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">iv</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">iv</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">iv</span>))
        }
        <span class="ruby-identifier">prop</span> = [<span class="ruby-identifier">internalProperty</span>(<span class="ruby-string">&#39;%ancestors&#39;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">ancestors</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span>])]
      <span class="ruby-keyword">when</span> <span class="ruby-constant">Range</span>
        <span class="ruby-identifier">prop</span> = [
          <span class="ruby-identifier">internalProperty</span>(<span class="ruby-string">&#39;#begin&#39;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">begin</span>),
          <span class="ruby-identifier">internalProperty</span>(<span class="ruby-string">&#39;#end&#39;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">end</span>),
        ]
      <span class="ruby-keyword">end</span>

      <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">M_INSTANCE_VARIABLES</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>).<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">iv</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">iv</span>, <span class="ruby-constant">M_INSTANCE_VARIABLE_GET</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-identifier">iv</span>))
      }
      <span class="ruby-identifier">prop</span> <span class="ruby-operator">+=</span> [<span class="ruby-identifier">internalProperty</span>(<span class="ruby-string">&#39;#class&#39;</span>, <span class="ruby-constant">M_CLASS</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>))]
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">event!</span> <span class="ruby-value">:protocol_result</span>, <span class="ruby-value">:properties</span>, <span class="ruby-identifier">req</span>, <span class="ruby-value">result:</span> <span class="ruby-identifier">result</span>, <span class="ruby-value">internalProperties:</span> <span class="ruby-identifier">prop</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:exception</span>
    <span class="ruby-identifier">oid</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
    <span class="ruby-identifier">exc</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">obj</span> = <span class="ruby-ivar">@obj_map</span>[<span class="ruby-identifier">oid</span>]
      <span class="ruby-identifier">exc</span> = <span class="ruby-identifier">exceptionDetails</span> <span class="ruby-identifier">obj</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">to_s</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">event!</span> <span class="ruby-value">:protocol_result</span>, <span class="ruby-value">:exception</span>, <span class="ruby-identifier">req</span>, <span class="ruby-value">exceptionDetails:</span> <span class="ruby-identifier">exc</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-process_dap" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">process_dap</span><span
                                class="method-args">(args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="process_dap-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_dap.rb, line 797</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process_dap</span> <span class="ruby-identifier">args</span>
  <span class="ruby-comment"># pp tc: self, args: args</span>
  <span class="ruby-identifier">type</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
  <span class="ruby-identifier">req</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:backtrace</span>
    <span class="ruby-identifier">start_frame</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;arguments&#39;</span>, <span class="ruby-string">&#39;startFrame&#39;</span>) <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">levels</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;arguments&#39;</span>, <span class="ruby-string">&#39;levels&#39;</span>) <span class="ruby-operator">||</span> <span class="ruby-value">1_000</span>
    <span class="ruby-identifier">frames</span> = []
    <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">frame</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">start_frame</span>

      <span class="ruby-identifier">path</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">realpath</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">path</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">skip_path?</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">SESSION</span>.<span class="ruby-identifier">stop_stepping?</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">lineno</span>)
      <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> (<span class="ruby-identifier">levels</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>) <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">source_name</span> = <span class="ruby-identifier">path</span> <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">to_s</span>

      <span class="ruby-keyword">if</span> (<span class="ruby-identifier">path</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">path</span>)) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">local_path</span> = <span class="ruby-constant">UI_DAP</span>.<span class="ruby-identifier">remote_to_local_path</span>(<span class="ruby-identifier">path</span>))
        <span class="ruby-comment"># ok</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">ref</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">file_lines</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-identifier">frames</span> <span class="ruby-operator">&lt;&lt;</span> {
        <span class="ruby-value">id:</span> <span class="ruby-identifier">i</span>, <span class="ruby-comment"># id is refilled by SESSION</span>
        <span class="ruby-value">name:</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">name</span>,
        <span class="ruby-value">line:</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">lineno</span>,
        <span class="ruby-value">column:</span> <span class="ruby-value">1</span>,
        <span class="ruby-value">source:</span> {
          <span class="ruby-value">name:</span> <span class="ruby-identifier">source_name</span>,
          <span class="ruby-value">path:</span> (<span class="ruby-identifier">local_path</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">path</span>),
          <span class="ruby-value">sourceReference:</span> <span class="ruby-identifier">ref</span>,
        },
      }
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">event!</span> <span class="ruby-value">:protocol_result</span>, <span class="ruby-value">:backtrace</span>, <span class="ruby-identifier">req</span>, {
      <span class="ruby-value">stackFrames:</span> <span class="ruby-identifier">frames</span>,
      <span class="ruby-value">totalFrames:</span> <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">size</span>,
    }
  <span class="ruby-keyword">when</span> <span class="ruby-value">:scopes</span>
    <span class="ruby-identifier">fid</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
    <span class="ruby-identifier">frame</span> = <span class="ruby-identifier">get_frame</span>(<span class="ruby-identifier">fid</span>)

    <span class="ruby-identifier">lnum</span> =
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">binding</span>
        <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">binding</span>.<span class="ruby-identifier">local_variables</span>.<span class="ruby-identifier">size</span>
      <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">vars</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">local_variables</span>
        <span class="ruby-identifier">vars</span>.<span class="ruby-identifier">size</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-value">0</span>
      <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">event!</span> <span class="ruby-value">:protocol_result</span>, <span class="ruby-value">:scopes</span>, <span class="ruby-identifier">req</span>, <span class="ruby-value">scopes:</span> [{
      <span class="ruby-value">name:</span> <span class="ruby-string">&#39;Local variables&#39;</span>,
      <span class="ruby-value">presentationHint:</span> <span class="ruby-string">&#39;locals&#39;</span>,
      <span class="ruby-comment"># variablesReference: N, # filled by SESSION</span>
      <span class="ruby-value">namedVariables:</span> <span class="ruby-identifier">lnum</span>,
      <span class="ruby-value">indexedVariables:</span> <span class="ruby-value">0</span>,
      <span class="ruby-value">expensive:</span> <span class="ruby-keyword">false</span>,
    }, {
      <span class="ruby-value">name:</span> <span class="ruby-string">&#39;Global variables&#39;</span>,
      <span class="ruby-value">presentationHint:</span> <span class="ruby-string">&#39;globals&#39;</span>,
      <span class="ruby-value">variablesReference:</span> <span class="ruby-value">1</span>, <span class="ruby-comment"># GLOBAL</span>
      <span class="ruby-value">namedVariables:</span> <span class="ruby-identifier">safe_global_variables</span>.<span class="ruby-identifier">size</span>,
      <span class="ruby-value">indexedVariables:</span> <span class="ruby-value">0</span>,
      <span class="ruby-value">expensive:</span> <span class="ruby-keyword">false</span>,
    }]
  <span class="ruby-keyword">when</span> <span class="ruby-value">:scope</span>
    <span class="ruby-identifier">fid</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
    <span class="ruby-identifier">frame</span> = <span class="ruby-identifier">get_frame</span>(<span class="ruby-identifier">fid</span>)
    <span class="ruby-identifier">vars</span> = <span class="ruby-identifier">collect_locals</span>(<span class="ruby-identifier">frame</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">var</span>, <span class="ruby-identifier">val</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">event!</span> <span class="ruby-value">:protocol_result</span>, <span class="ruby-value">:scope</span>, <span class="ruby-identifier">req</span>, <span class="ruby-value">variables:</span> <span class="ruby-identifier">vars</span>, <span class="ruby-value">tid:</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">id</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:variable</span>
    <span class="ruby-identifier">vid</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
    <span class="ruby-identifier">obj</span> = <span class="ruby-ivar">@var_map</span>[<span class="ruby-identifier">vid</span>]
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">obj</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;arguments&#39;</span>, <span class="ruby-string">&#39;filter&#39;</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;indexed&#39;</span>
        <span class="ruby-identifier">start</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;arguments&#39;</span>, <span class="ruby-string">&#39;start&#39;</span>) <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
        <span class="ruby-identifier">count</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;arguments&#39;</span>, <span class="ruby-string">&#39;count&#39;</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">size</span>
        <span class="ruby-identifier">vars</span> = (<span class="ruby-identifier">start</span> <span class="ruby-operator">...</span> (<span class="ruby-identifier">start</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">count</span>)).<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">obj</span>[<span class="ruby-identifier">i</span>])
        }
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">vars</span> = []

        <span class="ruby-keyword">case</span> <span class="ruby-identifier">obj</span>
        <span class="ruby-keyword">when</span> <span class="ruby-constant">Hash</span>
          <span class="ruby-identifier">vars</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
            <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">value_inspect</span>(<span class="ruby-identifier">k</span>), <span class="ruby-identifier">v</span>,)
          }
        <span class="ruby-keyword">when</span> <span class="ruby-constant">Struct</span>
          <span class="ruby-identifier">vars</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">members</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
            <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">m</span>, <span class="ruby-identifier">obj</span>[<span class="ruby-identifier">m</span>])
          }
        <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
          <span class="ruby-identifier">vars</span> = [
            <span class="ruby-identifier">variable</span>(<span class="ruby-string">&#39;#length&#39;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">length</span>),
            <span class="ruby-identifier">variable</span>(<span class="ruby-string">&#39;#encoding&#39;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">encoding</span>),
          ]
          <span class="ruby-identifier">printed_str</span> = <span class="ruby-identifier">value_inspect</span>(<span class="ruby-identifier">obj</span>)
          <span class="ruby-identifier">vars</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">variable</span>(<span class="ruby-string">&#39;#dump&#39;</span>, <span class="ruby-constant">NaiveString</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">obj</span>)) <span class="ruby-keyword">if</span> <span class="ruby-identifier">printed_str</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-string">&#39;...&#39;</span>)
        <span class="ruby-keyword">when</span> <span class="ruby-constant">Class</span>, <span class="ruby-constant">Module</span>
          <span class="ruby-identifier">vars</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">variable</span>(<span class="ruby-string">&#39;%ancestors&#39;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">ancestors</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span>])
        <span class="ruby-keyword">when</span> <span class="ruby-constant">Range</span>
          <span class="ruby-identifier">vars</span> = [
            <span class="ruby-identifier">variable</span>(<span class="ruby-string">&#39;#begin&#39;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">begin</span>),
            <span class="ruby-identifier">variable</span>(<span class="ruby-string">&#39;#end&#39;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">end</span>),
          ]
        <span class="ruby-keyword">end</span>

        <span class="ruby-keyword">unless</span> <span class="ruby-constant">NaiveString</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">obj</span>
          <span class="ruby-identifier">vars</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">M_INSTANCE_VARIABLES</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>).<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">iv</span><span class="ruby-operator">|</span>
            <span class="ruby-identifier">variable</span>(<span class="ruby-identifier">iv</span>, <span class="ruby-constant">M_INSTANCE_VARIABLE_GET</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-identifier">iv</span>))
          }
          <span class="ruby-identifier">vars</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">variable</span>(<span class="ruby-string">&#39;#class&#39;</span>, <span class="ruby-constant">M_CLASS</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>))
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">event!</span> <span class="ruby-value">:protocol_result</span>, <span class="ruby-value">:variable</span>, <span class="ruby-identifier">req</span>, <span class="ruby-value">variables:</span> (<span class="ruby-identifier">vars</span> <span class="ruby-operator">||</span> []), <span class="ruby-value">tid:</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">id</span>

  <span class="ruby-keyword">when</span> <span class="ruby-value">:evaluate</span>
    <span class="ruby-identifier">fid</span>, <span class="ruby-identifier">expr</span>, <span class="ruby-identifier">context</span> = <span class="ruby-identifier">args</span>
    <span class="ruby-identifier">frame</span> = <span class="ruby-identifier">get_frame</span>(<span class="ruby-identifier">fid</span>)
    <span class="ruby-identifier">message</span> = <span class="ruby-keyword">nil</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">frame</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">b</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">eval_binding</span>)
      <span class="ruby-identifier">special_local_variables</span> <span class="ruby-identifier">frame</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">var</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">b</span>.<span class="ruby-identifier">local_variable_set</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">var</span>) <span class="ruby-keyword">if</span> <span class="ruby-regexp">/\%/</span> <span class="ruby-operator">!~</span> <span class="ruby-identifier">name</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-keyword">case</span> <span class="ruby-identifier">context</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;repl&#39;</span>, <span class="ruby-string">&#39;watch&#39;</span>
        <span class="ruby-identifier">result</span> = <span class="ruby-identifier">dap_eval</span> <span class="ruby-identifier">b</span>, <span class="ruby-identifier">expr</span>, <span class="ruby-identifier">context</span>, <span class="ruby-value">prompt:</span> <span class="ruby-string">&#39;(DEBUG CONSOLE)&#39;</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;hover&#39;</span>
        <span class="ruby-keyword">case</span> <span class="ruby-identifier">expr</span>
        <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A\@\S/</span>
          <span class="ruby-keyword">begin</span>
            <span class="ruby-identifier">result</span> = <span class="ruby-constant">M_INSTANCE_VARIABLE_GET</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">b</span>.<span class="ruby-identifier">receiver</span>, <span class="ruby-identifier">expr</span>)
          <span class="ruby-keyword">rescue</span> <span class="ruby-constant">NameError</span>
            <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Error: Not defined instance variable: #{expr.inspect}&quot;</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A\$\S/</span>
          <span class="ruby-identifier">safe_global_variables</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">gvar</span><span class="ruby-operator">|</span>
            <span class="ruby-keyword">if</span> <span class="ruby-identifier">gvar</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">expr</span>
              <span class="ruby-identifier">result</span> = <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">gvar</span>.<span class="ruby-identifier">to_s</span>)
              <span class="ruby-keyword">break</span> <span class="ruby-keyword">false</span>
            <span class="ruby-keyword">end</span>
          } <span class="ruby-keyword">and</span> (<span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Error: Not defined global variable: #{expr.inspect}&quot;</span>)
        <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\Aself$/</span>
          <span class="ruby-identifier">result</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">receiver</span>
        <span class="ruby-keyword">when</span> <span class="ruby-regexp">/(\A((::[A-Z]|[A-Z])\w*)+)/</span>
          <span class="ruby-keyword">unless</span> <span class="ruby-identifier">result</span> = <span class="ruby-identifier">search_const</span>(<span class="ruby-identifier">b</span>, <span class="ruby-node">$1</span>)
            <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Error: Not defined constants: #{expr.inspect}&quot;</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-keyword">begin</span>
            <span class="ruby-identifier">result</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">local_variable_get</span>(<span class="ruby-identifier">expr</span>)
          <span class="ruby-keyword">rescue</span> <span class="ruby-constant">NameError</span>
            <span class="ruby-comment"># try to check method</span>
            <span class="ruby-keyword">if</span> <span class="ruby-constant">M_RESPOND_TO_P</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">b</span>.<span class="ruby-identifier">receiver</span>, <span class="ruby-identifier">expr</span>, <span class="ruby-value">include_all:</span> <span class="ruby-keyword">true</span>)
              <span class="ruby-identifier">result</span> = <span class="ruby-constant">M_METHOD</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">b</span>.<span class="ruby-identifier">receiver</span>, <span class="ruby-identifier">expr</span>)
            <span class="ruby-keyword">else</span>
              <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Error: Can not evaluate: #{expr.inspect}&quot;</span>
            <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Error: unknown context: #{context}&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">result</span> = <span class="ruby-string">&#39;Error: Can not evaluate on this frame&#39;</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">event!</span> <span class="ruby-value">:protocol_result</span>, <span class="ruby-value">:evaluate</span>, <span class="ruby-identifier">req</span>, <span class="ruby-value">message:</span> <span class="ruby-identifier">message</span>, <span class="ruby-value">tid:</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">id</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">evaluate_result</span>(<span class="ruby-identifier">result</span>)

  <span class="ruby-keyword">when</span> <span class="ruby-value">:completions</span>
    <span class="ruby-identifier">fid</span>, <span class="ruby-identifier">text</span> = <span class="ruby-identifier">args</span>
    <span class="ruby-identifier">frame</span> = <span class="ruby-identifier">get_frame</span>(<span class="ruby-identifier">fid</span>)

    <span class="ruby-keyword">if</span> (<span class="ruby-identifier">b</span> = <span class="ruby-identifier">frame</span>&amp;.<span class="ruby-identifier">binding</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">word</span> = <span class="ruby-identifier">text</span>&amp;.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">/[\s\{]/</span>)&amp;.<span class="ruby-identifier">last</span>
      <span class="ruby-identifier">words</span> = <span class="ruby-constant">IRB</span><span class="ruby-operator">::</span><span class="ruby-constant">InputCompletor</span><span class="ruby-operator">::</span><span class="ruby-identifier">retrieve_completion_data</span>(<span class="ruby-identifier">word</span>, <span class="ruby-value">bind:</span> <span class="ruby-identifier">b</span>).<span class="ruby-identifier">compact</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">event!</span> <span class="ruby-value">:protocol_result</span>, <span class="ruby-value">:completions</span>, <span class="ruby-identifier">req</span>, <span class="ruby-value">targets:</span> (<span class="ruby-identifier">words</span> <span class="ruby-operator">||</span> []).<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">phrase</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">detail</span> = <span class="ruby-keyword">nil</span>

      <span class="ruby-keyword">if</span> <span class="ruby-regexp">/\b([_a-zA-Z]\w*[!\?]?)\z/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">phrase</span>
        <span class="ruby-identifier">w</span> = <span class="ruby-node">$1</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">w</span> = <span class="ruby-identifier">phrase</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-keyword">begin</span>
        <span class="ruby-identifier">v</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">local_variable_get</span>(<span class="ruby-identifier">w</span>)
        <span class="ruby-identifier">detail</span> =<span class="ruby-node">&quot;(variable: #{value_inspect(v)})&quot;</span>
      <span class="ruby-keyword">rescue</span> <span class="ruby-constant">NameError</span>
      <span class="ruby-keyword">end</span>

      {
        <span class="ruby-value">label:</span> <span class="ruby-identifier">phrase</span>,
        <span class="ruby-value">text:</span> <span class="ruby-identifier">w</span>,
        <span class="ruby-value">detail:</span> <span class="ruby-identifier">detail</span>,
      }
    }

  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">mid</span> = <span class="ruby-node">&quot;custom_dap_request_#{type}&quot;</span>
      <span class="ruby-identifier">__send__</span> <span class="ruby-identifier">mid</span>, <span class="ruby-identifier">req</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown request: #{args.inspect}&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-propertyDescriptor" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">propertyDescriptor</span><span
                                class="method-args">(name, obj)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="propertyDescriptor-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 1321</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">propertyDescriptor</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">obj</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Array</span>
    <span class="ruby-identifier">propertyDescriptor_</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-string">&#39;object&#39;</span>, <span class="ruby-value">subtype:</span> <span class="ruby-string">&#39;array&#39;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Hash</span>
    <span class="ruby-identifier">propertyDescriptor_</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-string">&#39;object&#39;</span>, <span class="ruby-value">subtype:</span> <span class="ruby-string">&#39;map&#39;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
    <span class="ruby-identifier">propertyDescriptor_</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-string">&#39;string&#39;</span>, <span class="ruby-value">description:</span> <span class="ruby-identifier">obj</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">TrueClass</span>, <span class="ruby-constant">FalseClass</span>
    <span class="ruby-identifier">propertyDescriptor_</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-string">&#39;boolean&#39;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Symbol</span>
    <span class="ruby-identifier">propertyDescriptor_</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-string">&#39;symbol&#39;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Integer</span>, <span class="ruby-constant">Float</span>
    <span class="ruby-identifier">propertyDescriptor_</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-string">&#39;number&#39;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Exception</span>
    <span class="ruby-identifier">bt</span> = <span class="ruby-string">&#39;&#39;</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">log</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">backtrace_locations</span>
      <span class="ruby-identifier">log</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">loc</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">loc</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">__FILE__</span>
        <span class="ruby-identifier">bt</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot;    #{loc}\n&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">propertyDescriptor_</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-string">&#39;object&#39;</span>, <span class="ruby-value">description:</span> <span class="ruby-node">&quot;#{obj.inspect}\n#{bt}&quot;</span>, <span class="ruby-value">subtype:</span> <span class="ruby-string">&#39;error&#39;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">propertyDescriptor_</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-string">&#39;object&#39;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-propertyDescriptor_" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">propertyDescriptor_</span><span
                                class="method-args">(name, obj, type, description: nil, subtype: nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="propertyDescriptor_-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 1229</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">propertyDescriptor_</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-identifier">type</span>, <span class="ruby-value">description:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">subtype:</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">description</span> = <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">safe_inspect</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-value">short:</span> <span class="ruby-keyword">true</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">description</span>.<span class="ruby-identifier">nil?</span>
  <span class="ruby-identifier">oid</span> = <span class="ruby-identifier">rand</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-ivar">@obj_map</span>[<span class="ruby-identifier">oid</span>] = <span class="ruby-identifier">obj</span>
  <span class="ruby-identifier">prop</span> = {
    <span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>,
    <span class="ruby-value">value:</span> {
      <span class="ruby-value">type:</span> <span class="ruby-identifier">type</span>,
      <span class="ruby-value">description:</span> <span class="ruby-identifier">description</span>,
      <span class="ruby-value">value:</span> <span class="ruby-identifier">obj</span>,
      <span class="ruby-value">objectId:</span> <span class="ruby-identifier">oid</span>
    },
    <span class="ruby-value">configurable:</span> <span class="ruby-keyword">true</span>, <span class="ruby-comment"># TODO: Change these parts because</span>
    <span class="ruby-value">enumerable:</span> <span class="ruby-keyword">true</span>    <span class="ruby-comment">#       they are not necessarily `true`.</span>
  }

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;object&#39;</span>
    <span class="ruby-identifier">v</span> = <span class="ruby-identifier">prop</span>[<span class="ruby-value">:value</span>]
    <span class="ruby-identifier">v</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value">:value</span>
    <span class="ruby-identifier">v</span>[<span class="ruby-value">:subtype</span>] = <span class="ruby-identifier">subtype</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">subtype</span>
    <span class="ruby-identifier">v</span>[<span class="ruby-value">:className</span>] = (<span class="ruby-identifier">klass</span> = <span class="ruby-constant">M_CLASS</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>)).<span class="ruby-identifier">name</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">prop</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-puts" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">puts</span><span
                                class="method-args">(str = &#39;&#39;)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="puts-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 197</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">puts</span> <span class="ruby-identifier">str</span> = <span class="ruby-string">&#39;&#39;</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@recorder</span>&amp;.<span class="ruby-identifier">replaying?</span>
    <span class="ruby-identifier">prefix</span> = <span class="ruby-identifier">colorize_dim</span>(<span class="ruby-string">&quot;[replay] &quot;</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">str</span>
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Array</span>
    <span class="ruby-identifier">str</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">puts</span> <span class="ruby-identifier">s</span>}
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{prefix}#{str.chomp}\n&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-puts_variable_info" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">puts_variable_info</span><span
                                class="method-args">(label, obj, pat)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="puts_variable_info-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 666</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">puts_variable_info</span> <span class="ruby-identifier">label</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-identifier">pat</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">pat</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">pat</span> <span class="ruby-operator">!~</span> <span class="ruby-identifier">label</span>

  <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">inspected</span> = <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">safe_inspect</span>(<span class="ruby-identifier">obj</span>)
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
    <span class="ruby-identifier">inspected</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">inspect</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">mono_info</span> = <span class="ruby-node">&quot;#{label} = #{inspected}&quot;</span>

  <span class="ruby-identifier">w</span> = <span class="ruby-constant">SESSION</span><span class="ruby-operator">::</span><span class="ruby-identifier">width</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">mono_info</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">w</span>
    <span class="ruby-identifier">maximum_value_width</span> = <span class="ruby-identifier">w</span> <span class="ruby-operator">-</span> <span class="ruby-node">&quot;#{label} = &quot;</span>.<span class="ruby-identifier">length</span>
    <span class="ruby-identifier">valstr</span> = <span class="ruby-identifier">truncate</span>(<span class="ruby-identifier">inspected</span>, <span class="ruby-value">width:</span> <span class="ruby-identifier">maximum_value_width</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">valstr</span> = <span class="ruby-identifier">colored_inspect</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-value">width:</span> <span class="ruby-value">2</span> <span class="ruby-operator">**</span> <span class="ruby-value">30</span>)
    <span class="ruby-identifier">valstr</span> = <span class="ruby-identifier">inspected</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">valstr</span>.<span class="ruby-identifier">lines</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">info</span> = <span class="ruby-node">&quot;#{colorize_cyan(label)} = #{valstr}&quot;</span>

  <span class="ruby-identifier">puts</span> <span class="ruby-identifier">info</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-replay_suspend" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">replay_suspend</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="replay_suspend-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 324</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">replay_suspend</span>
  <span class="ruby-comment"># @recorder.current_position</span>
  <span class="ruby-identifier">suspend</span> <span class="ruby-value">:replay</span>, <span class="ruby-value">replay_frames:</span> <span class="ruby-ivar">@recorder</span>.<span class="ruby-identifier">current_frame</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-running-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">running?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="running-3F-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 167</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">running?</span>
  <span class="ruby-ivar">@mode</span> <span class="ruby-operator">==</span> <span class="ruby-value">:running</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-search_const" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">search_const</span><span
                                class="method-args">(b, expr)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="search_const-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 1196</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">search_const</span> <span class="ruby-identifier">b</span>, <span class="ruby-identifier">expr</span>
  <span class="ruby-identifier">cs</span> = <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">delete_prefix</span>(<span class="ruby-string">&#39;::&#39;</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;::&#39;</span>)
  [<span class="ruby-constant">Object</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">b</span>.<span class="ruby-identifier">eval</span>(<span class="ruby-string">&#39;::Module.nesting&#39;</span>)].<span class="ruby-identifier">reverse_each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">cs</span>.<span class="ruby-identifier">all?</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
         <span class="ruby-keyword">if</span> <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">const_defined?</span>(<span class="ruby-identifier">c</span>)
           <span class="ruby-keyword">begin</span>
             <span class="ruby-identifier">mod</span> = <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">c</span>)
           <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span>
             <span class="ruby-keyword">false</span>
           <span class="ruby-keyword">end</span>
         <span class="ruby-keyword">else</span>
           <span class="ruby-keyword">false</span>
         <span class="ruby-keyword">end</span>
       }
      <span class="ruby-comment"># if-body</span>
      <span class="ruby-keyword">return</span> <span class="ruby-identifier">mod</span>
    <span class="ruby-keyword">end</span>
  }
  <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_mode" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_mode</span><span
                                class="method-args">(mode)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_mode-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 147</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_mode</span> <span class="ruby-identifier">mode</span>
  <span class="ruby-identifier">debug_mode</span>(<span class="ruby-ivar">@mode</span>, <span class="ruby-identifier">mode</span>)
  <span class="ruby-comment"># STDERR.puts &quot;#{@mode} =&gt; #{mode} @ #{caller.inspect}&quot;</span>
  <span class="ruby-comment"># pp caller</span>

  <span class="ruby-comment"># mode transition check</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">mode</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:running</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;#{mode} is given, but #{mode}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">waiting?</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:waiting</span>
    <span class="ruby-comment"># TODO: there is waiting -&gt; waiting</span>
    <span class="ruby-comment"># raise &quot;#{mode} is given, but #{mode}&quot; unless self.running?</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unknown mode: #{mode}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># DEBUGGER__.warn &quot;#{@mode} =&gt; #{mode} @ #{self.inspect}&quot;</span>
  <span class="ruby-ivar">@mode</span> = <span class="ruby-identifier">mode</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_by_editor" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_by_editor</span><span
                                class="method-args">(path = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>cmd: show edit</p>

                              <div class="method-source-code" id="show_by_editor-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 701</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_by_editor</span> <span class="ruby-identifier">path</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">path</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">current_frame</span>
      <span class="ruby-identifier">path</span> = <span class="ruby-identifier">current_frame</span>.<span class="ruby-identifier">path</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">return</span> <span class="ruby-comment"># can&#39;t get path</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">path</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">editor</span> = (<span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;RUBY_DEBUG_EDITOR&#39;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;EDITOR&#39;</span>])
      <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;command: #{editor}&quot;</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;   path: #{path}&quot;</span>
      <span class="ruby-identifier">require</span> <span class="ruby-string">&#39;shellwords&#39;</span>
      <span class="ruby-identifier">system</span>(<span class="ruby-operator">*</span><span class="ruby-constant">Shellwords</span>.<span class="ruby-identifier">split</span>(<span class="ruby-identifier">editor</span>), <span class="ruby-identifier">path</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;can not find editor setting: ENV[&#39;RUBY_DEBUG_EDITOR&#39;] or ENV[&#39;EDITOR&#39;]&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Can not find file: #{path}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_consts" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_consts</span><span
                                class="method-args">(pat, expr = nil, only_self: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_consts-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 651</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_consts</span> <span class="ruby-identifier">pat</span>, <span class="ruby-identifier">expr</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-value">only_self:</span> <span class="ruby-keyword">false</span>
  <span class="ruby-identifier">get_consts</span> <span class="ruby-identifier">expr</span>, <span class="ruby-value">only_self:</span> <span class="ruby-identifier">only_self</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">puts_variable_info</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">pat</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_frame" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_frame</span><span
                                class="method-args">(i=0)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_frame-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 749</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_frame</span> <span class="ruby-identifier">i</span>=<span class="ruby-value">0</span>
  <span class="ruby-identifier">puts</span> <span class="ruby-identifier">frame_str</span>(<span class="ruby-identifier">i</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_frames" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_frames</span><span
                                class="method-args">(max = nil, pattern = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>cmd: show frames</p>

                              <div class="method-source-code" id="show_frames-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 726</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_frames</span> <span class="ruby-identifier">max</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">pattern</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@target_frames</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">max</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">size</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">frames</span> = []
    <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">each_with_index</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">f</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
      <span class="ruby-comment"># we need to use FrameInfo#matchable_location because #location_str is for display</span>
      <span class="ruby-comment"># and it may change based on configs (e.g. use_short_path)</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">pattern</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-identifier">pattern</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">matchable_location</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-identifier">pattern</span>))
      <span class="ruby-comment"># avoid using skip_path? because we still want to display internal frames</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">skip_config_skip_path?</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">matchable_location</span>)

      <span class="ruby-identifier">frames</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">i</span>, <span class="ruby-identifier">f</span>]
    }

    <span class="ruby-identifier">size</span> = <span class="ruby-identifier">frames</span>.<span class="ruby-identifier">size</span>
    <span class="ruby-identifier">max</span>.<span class="ruby-identifier">times</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">break</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">frames</span>[<span class="ruby-identifier">i</span>]
      <span class="ruby-identifier">index</span>, <span class="ruby-identifier">frame</span> = <span class="ruby-identifier">frames</span>[<span class="ruby-identifier">i</span>]
      <span class="ruby-identifier">puts</span> <span class="ruby-identifier">frame_str</span>(<span class="ruby-identifier">index</span>, <span class="ruby-value">frame:</span> <span class="ruby-identifier">frame</span>)
    }
    <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;  # and #{size - max} frames (use `bt&#39; command for all frames)&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">max</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">size</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_globals" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_globals</span><span
                                class="method-args">(pat)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_globals-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 657</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_globals</span> <span class="ruby-identifier">pat</span>
  <span class="ruby-identifier">safe_global_variables</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">SKIP_GLOBAL_LIST</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">name</span>

    <span class="ruby-identifier">value</span> = <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>)
    <span class="ruby-identifier">puts_variable_info</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">pat</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_ivars" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_ivars</span><span
                                class="method-args">(pat, expr = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_ivars-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 584</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_ivars</span> <span class="ruby-identifier">pat</span>, <span class="ruby-identifier">expr</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">expr</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">expr</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">_self</span> = <span class="ruby-identifier">frame_eval</span>(<span class="ruby-identifier">expr</span>);
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">_self</span> = <span class="ruby-identifier">current_frame</span>&amp;.<span class="ruby-identifier">self</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">_self</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">_self</span>
    <span class="ruby-constant">M_INSTANCE_VARIABLES</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">_self</span>).<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">iv</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">value</span> = <span class="ruby-constant">M_INSTANCE_VARIABLE_GET</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">_self</span>, <span class="ruby-identifier">iv</span>)
      <span class="ruby-identifier">puts_variable_info</span> <span class="ruby-identifier">iv</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">pat</span>
    }
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_locals" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_locals</span><span
                                class="method-args">(pat)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_locals-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 578</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_locals</span> <span class="ruby-identifier">pat</span>
  <span class="ruby-identifier">collect_locals</span>(<span class="ruby-identifier">current_frame</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">puts_variable_info</span>(<span class="ruby-identifier">var</span>, <span class="ruby-identifier">val</span>, <span class="ruby-identifier">pat</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_outline" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_outline</span><span
                                class="method-args">(expr)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>cmd: show outline</p>

                              <div class="method-source-code" id="show_outline-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 762</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_outline</span> <span class="ruby-identifier">expr</span>
  <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">obj</span> = <span class="ruby-identifier">frame_eval</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-value">re_raise:</span> <span class="ruby-keyword">true</span>)
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span>
    <span class="ruby-comment"># ignore</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">o</span> = <span class="ruby-constant">Output</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@output</span>)

    <span class="ruby-identifier">locals</span> = <span class="ruby-identifier">current_frame</span>&amp;.<span class="ruby-identifier">local_variables</span>

    <span class="ruby-identifier">klass</span> = <span class="ruby-constant">M_CLASS</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>)
    <span class="ruby-identifier">klass</span> = <span class="ruby-identifier">obj</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Class</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">klass</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Module</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">klass</span>

    <span class="ruby-identifier">o</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-string">&quot;constants&quot;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">constants</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">M_RESPOND_TO_P</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-value">:constants</span>)
    <span class="ruby-identifier">outline_method</span>(<span class="ruby-identifier">o</span>, <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">obj</span>)
    <span class="ruby-identifier">o</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-string">&quot;instance variables&quot;</span>, <span class="ruby-constant">M_INSTANCE_VARIABLES</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>))
    <span class="ruby-identifier">o</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-string">&quot;class variables&quot;</span>, <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">class_variables</span>)
    <span class="ruby-identifier">o</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-string">&quot;locals&quot;</span>, <span class="ruby-identifier">locals</span>.<span class="ruby-identifier">keys</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">locals</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_src" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_src</span><span
                                class="method-args">(frame_index: @current_frame_index, update_line: false, ignore_show_line: false, max_lines: CONFIG[:show_src_lines], **options)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_src-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 511</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_src</span>(<span class="ruby-value">frame_index:</span> <span class="ruby-ivar">@current_frame_index</span>, <span class="ruby-value">update_line:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">ignore_show_line:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">max_lines:</span> <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:show_src_lines</span>], <span class="ruby-operator">**</span><span class="ruby-identifier">options</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">frame</span> = <span class="ruby-identifier">get_frame</span>(<span class="ruby-identifier">frame_index</span>)
    <span class="ruby-keyword">begin</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">ignore_show_line</span>
        <span class="ruby-identifier">prev_show_line</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">show_line</span>
        <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">show_line</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-identifier">start_line</span>, <span class="ruby-identifier">end_line</span>, <span class="ruby-identifier">lines</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">get_src</span>(<span class="ruby-identifier">frame</span>, <span class="ruby-value">max_lines:</span> <span class="ruby-identifier">max_lines</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">options</span>)

      <span class="ruby-keyword">if</span> <span class="ruby-identifier">start_line</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">update_line</span>
          <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">show_line</span> = <span class="ruby-identifier">end_line</span>
        <span class="ruby-keyword">end</span>

        <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;[#{start_line+1}, #{end_line}] in #{frame.pretty_path}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">update_line</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">max_lines</span> <span class="ruby-operator">!=</span> <span class="ruby-value">1</span>
        <span class="ruby-identifier">puts</span> <span class="ruby-identifier">lines</span>[<span class="ruby-identifier">start_line</span><span class="ruby-operator">...</span><span class="ruby-identifier">end_line</span>]
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;# No sourcefile available for #{frame.path}&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">ensure</span>
      <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">show_line</span> = <span class="ruby-identifier">prev_show_line</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">prev_show_line</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-special_local_variables" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">special_local_variables</span><span
                                class="method-args">(frame) { |name, send| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>cmd: show</p>

                              <div class="method-source-code" id="special_local_variables-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 570</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">special_local_variables</span> <span class="ruby-identifier">frame</span>
  <span class="ruby-constant">SPECIAL_LOCAL_VARS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">mid</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">frame</span>&amp;.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;has_#{mid}&quot;</span>)
    <span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-string">&#39;_&#39;</span>, <span class="ruby-string">&#39;%&#39;</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">eval_binding</span>.<span class="ruby-identifier">local_variable_defined?</span>(<span class="ruby-identifier">name</span>)
    <span class="ruby-keyword">yield</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">mid</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-step_tp" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">step_tp</span><span
                                class="method-args">(iter, events = [:line, :b_return, :return]) { |tp| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="step_tp-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 338</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">step_tp</span> <span class="ruby-identifier">iter</span>, <span class="ruby-identifier">events</span> = [<span class="ruby-value">:line</span>, <span class="ruby-value">:b_return</span>, <span class="ruby-value">:return</span>]
  <span class="ruby-ivar">@step_tp</span>.<span class="ruby-identifier">disable</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@step_tp</span>

  <span class="ruby-identifier">thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>
  <span class="ruby-identifier">subsession_id</span> = <span class="ruby-constant">SESSION</span>.<span class="ruby-identifier">subsession_id</span>

  <span class="ruby-keyword">if</span> <span class="ruby-constant">SUPPORT_TARGET_THREAD</span>
    <span class="ruby-ivar">@step_tp</span> = <span class="ruby-constant">TracePoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">events</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-constant">SESSION</span>.<span class="ruby-identifier">stop_stepping?</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">path</span>, <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">lineno</span>, <span class="ruby-identifier">subsession_id</span>
        <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">disable</span>
        <span class="ruby-keyword">next</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword">yield</span>(<span class="ruby-identifier">tp</span>)
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">__dir__</span>)
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&#39;&lt;internal:trace_point&gt;&#39;</span>)
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">tp</span>.<span class="ruby-identifier">path</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:skip_nosrc</span>]
      <span class="ruby-identifier">loc</span> = <span class="ruby-identifier">caller_locations</span>(<span class="ruby-value">1</span>, <span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">skip_location?</span>(<span class="ruby-identifier">loc</span>)
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">iter</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">iter</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>

      <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">disable</span>
      <span class="ruby-identifier">suspend</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">event</span>, <span class="ruby-identifier">tp</span>
    }
    <span class="ruby-ivar">@step_tp</span>.<span class="ruby-identifier">enable</span>(<span class="ruby-value">target_thread:</span> <span class="ruby-identifier">thread</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@step_tp</span> = <span class="ruby-constant">TracePoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">events</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">thread</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>
      <span class="ruby-keyword">if</span> <span class="ruby-constant">SESSION</span>.<span class="ruby-identifier">stop_stepping?</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">path</span>, <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">lineno</span>, <span class="ruby-identifier">subsession_id</span>
        <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">disable</span>
        <span class="ruby-keyword">next</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword">yield</span>(<span class="ruby-identifier">tp</span>)
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">__dir__</span>)
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&#39;&lt;internal:trace_point&gt;&#39;</span>)
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">tp</span>.<span class="ruby-identifier">path</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:skip_nosrc</span>]
      <span class="ruby-identifier">loc</span> = <span class="ruby-identifier">caller_locations</span>(<span class="ruby-value">1</span>, <span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">skip_location?</span>(<span class="ruby-identifier">loc</span>)
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">iter</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">iter</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>

      <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">disable</span>
      <span class="ruby-identifier">suspend</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">event</span>, <span class="ruby-identifier">tp</span>
    }
    <span class="ruby-ivar">@step_tp</span>.<span class="ruby-identifier">enable</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-suspend" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">suspend</span><span
                                class="method-args">(event, tp = nil, bp: nil, sig: nil, postmortem_frames: nil, replay_frames: nil, postmortem_exc: nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="suspend-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 267</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">suspend</span> <span class="ruby-identifier">event</span>, <span class="ruby-identifier">tp</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-value">bp:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">sig:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">postmortem_frames:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">replay_frames:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">postmortem_exc:</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">management?</span>
  <span class="ruby-identifier">debug_suspend</span>(<span class="ruby-identifier">event</span>)

  <span class="ruby-ivar">@current_frame_index</span> = <span class="ruby-value">0</span>

  <span class="ruby-keyword">case</span>
  <span class="ruby-keyword">when</span> <span class="ruby-identifier">postmortem_frames</span>
    <span class="ruby-ivar">@target_frames</span> = <span class="ruby-identifier">postmortem_frames</span>
    <span class="ruby-ivar">@postmortem</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">when</span> <span class="ruby-identifier">replay_frames</span>
    <span class="ruby-ivar">@target_frames</span> = <span class="ruby-identifier">replay_frames</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@target_frames</span> = <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">capture_frames</span>(<span class="ruby-identifier">__dir__</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">cf</span> = <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">first</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">cf</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">event</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:return</span>, <span class="ruby-value">:b_return</span>, <span class="ruby-value">:c_return</span>
      <span class="ruby-identifier">cf</span>.<span class="ruby-identifier">has_return_value</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-identifier">cf</span>.<span class="ruby-identifier">return_value</span> = <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">return_value</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-constant">CatchBreakpoint</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">bp</span>
      <span class="ruby-identifier">cf</span>.<span class="ruby-identifier">has_raised_exception</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-identifier">cf</span>.<span class="ruby-identifier">raised_exception</span> = <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">last_exc</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">postmortem_exc</span>
      <span class="ruby-identifier">cf</span>.<span class="ruby-identifier">has_raised_exception</span> = <span class="ruby-keyword">true</span>
      <span class="ruby-identifier">cf</span>.<span class="ruby-identifier">raised_exception</span> = <span class="ruby-identifier">postmortem_exc</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">event</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:pause</span>
    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">bp</span>&amp;.<span class="ruby-identifier">skip_src</span>
      <span class="ruby-identifier">show_src</span>
      <span class="ruby-identifier">show_frames</span> <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:show_frames</span>]
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">set_mode</span> <span class="ruby-value">:waiting</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">bp</span>
      <span class="ruby-identifier">event!</span> <span class="ruby-value">:suspend</span>, <span class="ruby-value">:breakpoint</span>, <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">key</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">sig</span>
      <span class="ruby-identifier">event!</span> <span class="ruby-value">:suspend</span>, <span class="ruby-value">:trap</span>, <span class="ruby-identifier">sig</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">event!</span> <span class="ruby-value">:suspend</span>, <span class="ruby-identifier">event</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">set_mode</span> <span class="ruby-value">:waiting</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">wait_next_action</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_s" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_s</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_s-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 191</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
  <span class="ruby-identifier">str</span> = <span class="ruby-node">&quot;(#{@thread.name || @thread.status})@#{current_frame&amp;.location || @thread.to_s}&quot;</span>
  <span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot; (not under control)&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">waiting?</span>
  <span class="ruby-identifier">str</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-tp_allow_reentry" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tp_allow_reentry</span><span
                                class="method-args">() { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="tp_allow_reentry-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 387</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tp_allow_reentry</span>
  <span class="ruby-constant">TracePoint</span>.<span class="ruby-identifier">allow_reentry</span> <span class="ruby-keyword">do</span>
    <span class="ruby-keyword">yield</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">RuntimeError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-comment"># on the postmortem mode, it is not stopped in TracePoint</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;No need to allow reentrance.&#39;</span>
    <span class="ruby-keyword">yield</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-truncate" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">truncate</span><span
                                class="method-args">(string, width:)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="truncate-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 691</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">truncate</span>(<span class="ruby-identifier">string</span>, <span class="ruby-value">width:</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">string</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;#&lt;&quot;</span>)
    <span class="ruby-identifier">string</span>[<span class="ruby-value">0</span> <span class="ruby-operator">..</span> (<span class="ruby-identifier">width</span><span class="ruby-value">-5</span>)] <span class="ruby-operator">+</span> <span class="ruby-string">&#39;...&gt;&#39;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">string</span>[<span class="ruby-value">0</span> <span class="ruby-operator">..</span> (<span class="ruby-identifier">width</span><span class="ruby-value">-4</span>)] <span class="ruby-operator">+</span> <span class="ruby-string">&#39;...&#39;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-type_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">type_name</span><span
                                class="method-args">(obj)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="type_name-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_dap.rb, line 1042</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">type_name</span> <span class="ruby-identifier">obj</span>
  <span class="ruby-identifier">klass</span> = <span class="ruby-constant">M_CLASS</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>)

  <span class="ruby-keyword">begin</span>
    <span class="ruby-constant">M_NAME</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">klass</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
    <span class="ruby-node">&quot;&lt;Error: #{e.message} (#{e.backtrace.first}&gt;&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-value_inspect" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">value_inspect</span><span
                                class="method-args">(obj, short: true)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="value_inspect-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_dap.rb, line 778</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">value_inspect</span> <span class="ruby-identifier">obj</span>, <span class="ruby-value">short:</span> <span class="ruby-keyword">true</span>
  <span class="ruby-comment"># TODO: max length should be configuarable?</span>
  <span class="ruby-identifier">str</span> = <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">safe_inspect</span> <span class="ruby-identifier">obj</span>, <span class="ruby-value">short:</span> <span class="ruby-identifier">short</span>, <span class="ruby-value">max_length:</span> <span class="ruby-constant">MAX_LENGTH</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">encoding</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UTF_8</span>
    <span class="ruby-identifier">str</span>.<span class="ruby-identifier">scrub</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">str</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UTF_8</span>, <span class="ruby-value">invalid:</span> <span class="ruby-value">:replace</span>, <span class="ruby-value">undef:</span> <span class="ruby-value">:replace</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-variable" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">variable</span><span
                                class="method-args">(name, obj)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="variable-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 1275</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">variable</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>
  <span class="ruby-identifier">pd</span> = <span class="ruby-identifier">propertyDescriptor</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">obj</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Array</span>
    <span class="ruby-identifier">pd</span>[<span class="ruby-value">:value</span>][<span class="ruby-value">:preview</span>] = <span class="ruby-identifier">preview</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>
    <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">each_with_index</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">item</span>, <span class="ruby-identifier">idx</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">valuePreview</span> = <span class="ruby-identifier">preview</span>(<span class="ruby-identifier">idx</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">item</span>)
        <span class="ruby-identifier">pd</span>[<span class="ruby-value">:value</span>][<span class="ruby-value">:preview</span>][<span class="ruby-value">:properties</span>][<span class="ruby-identifier">idx</span>][<span class="ruby-value">:valuePreview</span>] = <span class="ruby-identifier">valuePreview</span>
      <span class="ruby-keyword">end</span>
    }
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Hash</span>
    <span class="ruby-identifier">pd</span>[<span class="ruby-value">:value</span>][<span class="ruby-value">:preview</span>] = <span class="ruby-identifier">preview</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>
    <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">each_with_index</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">item</span>, <span class="ruby-identifier">idx</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span> = <span class="ruby-identifier">item</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">valuePreview</span> = <span class="ruby-identifier">preview</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>)
        <span class="ruby-identifier">pd</span>[<span class="ruby-value">:value</span>][<span class="ruby-value">:preview</span>][<span class="ruby-value">:properties</span>][<span class="ruby-identifier">idx</span>][<span class="ruby-value">:valuePreview</span>] = <span class="ruby-identifier">valuePreview</span>
      <span class="ruby-keyword">end</span>
    }
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">pd</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-variable_" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">variable_</span><span
                                class="method-args">(name, obj, indexedVariables: 0, namedVariables: 0)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="variable_-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_dap.rb, line 1052</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">variable_</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">obj</span>, <span class="ruby-value">indexedVariables:</span> <span class="ruby-value">0</span>, <span class="ruby-value">namedVariables:</span> <span class="ruby-value">0</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">indexedVariables</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">namedVariables</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">vid</span> = <span class="ruby-ivar">@var_map</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
    <span class="ruby-ivar">@var_map</span>[<span class="ruby-identifier">vid</span>] = <span class="ruby-identifier">obj</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">vid</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">namedVariables</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">M_INSTANCE_VARIABLES</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>).<span class="ruby-identifier">size</span>

  <span class="ruby-keyword">if</span> <span class="ruby-constant">NaiveString</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">obj</span>
    <span class="ruby-identifier">str</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">str</span>.<span class="ruby-identifier">dump</span>
    <span class="ruby-identifier">vid</span> = <span class="ruby-identifier">indexedVariables</span> = <span class="ruby-identifier">namedVariables</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">str</span> = <span class="ruby-identifier">value_inspect</span>(<span class="ruby-identifier">obj</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span>
    { <span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>,
      <span class="ruby-value">value:</span> <span class="ruby-identifier">str</span>,
      <span class="ruby-value">type:</span> <span class="ruby-identifier">type_name</span>(<span class="ruby-identifier">obj</span>),
      <span class="ruby-value">variablesReference:</span> <span class="ruby-identifier">vid</span>,
      <span class="ruby-value">indexedVariables:</span> <span class="ruby-identifier">indexedVariables</span>,
      <span class="ruby-value">namedVariables:</span> <span class="ruby-identifier">namedVariables</span>,
    }
  <span class="ruby-keyword">else</span>
    { <span class="ruby-value">result:</span> <span class="ruby-identifier">str</span>,
      <span class="ruby-value">type:</span> <span class="ruby-identifier">type_name</span>(<span class="ruby-identifier">obj</span>),
      <span class="ruby-value">variablesReference:</span> <span class="ruby-identifier">vid</span>,
      <span class="ruby-value">indexedVariables:</span> <span class="ruby-identifier">indexedVariables</span>,
      <span class="ruby-value">namedVariables:</span> <span class="ruby-identifier">namedVariables</span>,
    }
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-wait_next_action" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">wait_next_action</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="wait_next_action-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 865</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">wait_next_action</span>
  <span class="ruby-identifier">wait_next_action_</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">SuspendReplay</span>
  <span class="ruby-identifier">replay_suspend</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-wait_next_action_" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">wait_next_action_</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="wait_next_action_-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 871</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">wait_next_action_</span>
  <span class="ruby-comment"># assertions</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;@mode is #{@mode}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">waiting?</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-constant">SESSION</span>.<span class="ruby-identifier">active?</span>
    <span class="ruby-identifier">pp</span> <span class="ruby-identifier">caller</span>
    <span class="ruby-identifier">set_mode</span> <span class="ruby-value">:running</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">while</span> <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">set_mode</span> <span class="ruby-value">:waiting</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">waiting?</span>
      <span class="ruby-identifier">cmds</span> = <span class="ruby-ivar">@q_cmd</span>.<span class="ruby-identifier">pop</span>
      <span class="ruby-comment"># pp [self, cmds: cmds]</span>

      <span class="ruby-keyword">break</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">cmds</span>
    <span class="ruby-keyword">ensure</span>
      <span class="ruby-identifier">set_mode</span> <span class="ruby-value">:running</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">cmd</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">cmds</span>

    <span class="ruby-keyword">case</span> <span class="ruby-identifier">cmd</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:continue</span>
      <span class="ruby-keyword">break</span>

    <span class="ruby-keyword">when</span> <span class="ruby-value">:step</span>
      <span class="ruby-identifier">step_type</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
      <span class="ruby-identifier">iter</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">1</span>]

      <span class="ruby-keyword">case</span> <span class="ruby-identifier">step_type</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:in</span>
        <span class="ruby-identifier">iter</span> = <span class="ruby-identifier">iter</span> <span class="ruby-operator">||</span> <span class="ruby-value">1</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@recorder</span>&amp;.<span class="ruby-identifier">replaying?</span>
          <span class="ruby-ivar">@recorder</span>.<span class="ruby-identifier">step_forward</span> <span class="ruby-identifier">iter</span>
          <span class="ruby-identifier">raise</span> <span class="ruby-constant">SuspendReplay</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">step_tp</span> <span class="ruby-identifier">iter</span> <span class="ruby-keyword">do</span>
            <span class="ruby-keyword">true</span>
          <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">break</span>
        <span class="ruby-keyword">end</span>

      <span class="ruby-keyword">when</span> <span class="ruby-value">:next</span>
        <span class="ruby-identifier">frame</span> = <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">first</span>
        <span class="ruby-identifier">path</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">absolute_path</span> <span class="ruby-operator">||</span> <span class="ruby-node">&quot;!eval:#{frame.path}&quot;</span>
        <span class="ruby-identifier">line</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">lineno</span>
        <span class="ruby-identifier">label</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">base_label</span>

        <span class="ruby-keyword">if</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">iseq</span>
          <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">traceable_lines_norec</span>(<span class="ruby-identifier">lines</span> = {})
          <span class="ruby-identifier">next_line</span> = <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">bsearch</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">line</span>}
          <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">next_line</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">last_line</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">last_line</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">line</span>
            <span class="ruby-identifier">next_line</span> = <span class="ruby-identifier">last_line</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>

        <span class="ruby-identifier">depth</span> = <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">frame_depth</span>

        <span class="ruby-identifier">step_tp</span> <span class="ruby-identifier">iter</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">loc</span> = <span class="ruby-identifier">caller_locations</span>(<span class="ruby-value">2</span>, <span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>
          <span class="ruby-identifier">loc_path</span> = <span class="ruby-identifier">loc</span>.<span class="ruby-identifier">absolute_path</span> <span class="ruby-operator">||</span> <span class="ruby-node">&quot;!eval:#{loc.path}&quot;</span>
          <span class="ruby-identifier">loc_label</span> = <span class="ruby-identifier">loc</span>.<span class="ruby-identifier">base_label</span>
          <span class="ruby-identifier">loc_depth</span> = <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">frame_depth</span> <span class="ruby-operator">-</span> <span class="ruby-value">3</span>

          <span class="ruby-keyword">case</span>
          <span class="ruby-keyword">when</span> <span class="ruby-identifier">loc_depth</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">loc_label</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">label</span>
            <span class="ruby-keyword">true</span>
          <span class="ruby-keyword">when</span> <span class="ruby-identifier">loc_depth</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">depth</span>
            <span class="ruby-comment"># lower stack depth</span>
            <span class="ruby-keyword">true</span>
          <span class="ruby-keyword">when</span> (<span class="ruby-identifier">next_line</span> <span class="ruby-operator">&amp;&amp;</span>
                <span class="ruby-identifier">loc_path</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">&amp;&amp;</span>
                (<span class="ruby-identifier">loc_lineno</span> = <span class="ruby-identifier">loc</span>.<span class="ruby-identifier">lineno</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">&amp;&amp;</span>
                <span class="ruby-identifier">loc_lineno</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">next_line</span>)
            <span class="ruby-comment"># different frame (maybe block) but the line is before next_line</span>
            <span class="ruby-keyword">true</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">break</span>

      <span class="ruby-keyword">when</span> <span class="ruby-value">:finish</span>
        <span class="ruby-identifier">finish_frames</span> = (<span class="ruby-identifier">iter</span> <span class="ruby-operator">||</span> <span class="ruby-value">1</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
        <span class="ruby-identifier">frame</span> = <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">first</span>
        <span class="ruby-identifier">goal_depth</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">frame_depth</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">finish_frames</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">frame</span>.<span class="ruby-identifier">has_return_value</span> <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>)

        <span class="ruby-identifier">step_tp</span> <span class="ruby-keyword">nil</span>, [<span class="ruby-value">:return</span>, <span class="ruby-value">:b_return</span>] <span class="ruby-keyword">do</span>
          <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">frame_depth</span> <span class="ruby-operator">-</span> <span class="ruby-value">3</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">goal_depth</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">break</span>

      <span class="ruby-keyword">when</span> <span class="ruby-value">:until</span>
        <span class="ruby-identifier">location</span> = <span class="ruby-identifier">iter</span>&amp;.<span class="ruby-identifier">strip</span>
        <span class="ruby-identifier">frame</span> = <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">first</span>
        <span class="ruby-identifier">depth</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">frame_depth</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">frame</span>.<span class="ruby-identifier">has_return_value</span> <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>)
        <span class="ruby-identifier">target_location_label</span> = <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">base_label</span>

        <span class="ruby-keyword">case</span> <span class="ruby-identifier">location</span>
        <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>, <span class="ruby-regexp">/\A(?:(.+):)?(\d+)\z/</span>
          <span class="ruby-identifier">no_loc</span> = <span class="ruby-operator">!</span><span class="ruby-identifier">location</span>
          <span class="ruby-identifier">file</span> = <span class="ruby-node">$1</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">path</span>
          <span class="ruby-identifier">line</span> = (<span class="ruby-node">$2</span> <span class="ruby-operator">||</span>  <span class="ruby-identifier">frame</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">lineno</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">to_i</span>

          <span class="ruby-identifier">step_tp</span> <span class="ruby-keyword">nil</span>, [<span class="ruby-value">:line</span>, <span class="ruby-value">:return</span>] <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
            <span class="ruby-keyword">if</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">event</span> <span class="ruby-operator">==</span> <span class="ruby-value">:line</span>
              <span class="ruby-keyword">next</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">no_loc</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">frame_depth</span> <span class="ruby-operator">-</span> <span class="ruby-value">3</span>
              <span class="ruby-keyword">next</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">end_with?</span>(<span class="ruby-identifier">file</span>)
              <span class="ruby-keyword">next</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">lineno</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">line</span>
              <span class="ruby-keyword">true</span>
            <span class="ruby-keyword">else</span>
              <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">frame_depth</span> <span class="ruby-operator">-</span> <span class="ruby-value">3</span> <span class="ruby-operator">&amp;&amp;</span>
                      <span class="ruby-identifier">caller_locations</span>(<span class="ruby-value">2</span>, <span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>.<span class="ruby-identifier">label</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">target_location_label</span>
                      <span class="ruby-comment"># TODO: imcomplete condition</span>
            <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">pat</span> = <span class="ruby-identifier">location</span>
          <span class="ruby-keyword">if</span> <span class="ruby-regexp">/\A\/(.+)\/\z/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">pat</span>
            <span class="ruby-identifier">pat</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">$1</span>)
          <span class="ruby-keyword">end</span>

          <span class="ruby-identifier">step_tp</span> <span class="ruby-keyword">nil</span>, [<span class="ruby-value">:call</span>, <span class="ruby-value">:c_call</span>, <span class="ruby-value">:return</span>] <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
            <span class="ruby-keyword">case</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">event</span>
            <span class="ruby-keyword">when</span> <span class="ruby-value">:call</span>, <span class="ruby-value">:c_call</span>
              <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">pat</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">callee_id</span>.<span class="ruby-identifier">to_s</span>
            <span class="ruby-keyword">else</span> <span class="ruby-comment"># :return, :b_return</span>
              <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">frame_depth</span> <span class="ruby-operator">-</span> <span class="ruby-value">3</span> <span class="ruby-operator">&amp;&amp;</span>
                      <span class="ruby-identifier">caller_locations</span>(<span class="ruby-value">2</span>, <span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>.<span class="ruby-identifier">label</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">target_location_label</span>
                      <span class="ruby-comment"># TODO: imcomplete condition</span>
            <span class="ruby-keyword">end</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>

        <span class="ruby-keyword">break</span>

      <span class="ruby-keyword">when</span> <span class="ruby-value">:back</span>
        <span class="ruby-identifier">iter</span> = <span class="ruby-identifier">iter</span> <span class="ruby-operator">||</span> <span class="ruby-value">1</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@recorder</span>&amp;.<span class="ruby-identifier">can_step_back?</span>
          <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@recorder</span>.<span class="ruby-identifier">backup_frames</span>
            <span class="ruby-ivar">@recorder</span>.<span class="ruby-identifier">backup_frames</span> = <span class="ruby-ivar">@target_frames</span>
          <span class="ruby-keyword">end</span>
          <span class="ruby-ivar">@recorder</span>.<span class="ruby-identifier">step_back</span> <span class="ruby-identifier">iter</span>
          <span class="ruby-identifier">raise</span> <span class="ruby-constant">SuspendReplay</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Can not step back more.&quot;</span>
          <span class="ruby-identifier">event!</span> <span class="ruby-value">:result</span>, <span class="ruby-keyword">nil</span>
        <span class="ruby-keyword">end</span>

      <span class="ruby-keyword">when</span> <span class="ruby-value">:reset</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@recorder</span>&amp;.<span class="ruby-identifier">replaying?</span>
          <span class="ruby-ivar">@recorder</span>.<span class="ruby-identifier">step_reset</span>
          <span class="ruby-identifier">raise</span> <span class="ruby-constant">SuspendReplay</span>
        <span class="ruby-keyword">end</span>

      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unknown: #{type}&quot;</span>
      <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">when</span> <span class="ruby-value">:eval</span>
      <span class="ruby-identifier">eval_type</span>, <span class="ruby-identifier">eval_src</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>

      <span class="ruby-identifier">result_type</span> = <span class="ruby-keyword">nil</span>

      <span class="ruby-keyword">case</span> <span class="ruby-identifier">eval_type</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:p</span>
        <span class="ruby-identifier">result</span> = <span class="ruby-identifier">frame_eval</span>(<span class="ruby-identifier">eval_src</span>)
        <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;=&gt; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">color_pp</span>(<span class="ruby-identifier">result</span>, <span class="ruby-value">2</span> <span class="ruby-operator">**</span> <span class="ruby-value">30</span>)
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">alloc_path</span> = <span class="ruby-constant">ObjectSpace</span>.<span class="ruby-identifier">allocation_sourcefile</span>(<span class="ruby-identifier">result</span>)
          <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;allocated at #{alloc_path}:#{ObjectSpace.allocation_sourceline(result)}&quot;</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:pp</span>
        <span class="ruby-identifier">result</span> = <span class="ruby-identifier">frame_eval</span>(<span class="ruby-identifier">eval_src</span>)
        <span class="ruby-identifier">puts</span> <span class="ruby-identifier">color_pp</span>(<span class="ruby-identifier">result</span>, <span class="ruby-constant">SESSION</span>.<span class="ruby-identifier">width</span>)
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">alloc_path</span> = <span class="ruby-constant">ObjectSpace</span>.<span class="ruby-identifier">allocation_sourcefile</span>(<span class="ruby-identifier">result</span>)
          <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;allocated at #{alloc_path}:#{ObjectSpace.allocation_sourceline(result)}&quot;</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:call</span>
        <span class="ruby-identifier">result</span> = <span class="ruby-identifier">frame_eval</span>(<span class="ruby-identifier">eval_src</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-value">:irb</span>
        <span class="ruby-identifier">require</span> <span class="ruby-string">&#39;irb&#39;</span> <span class="ruby-comment"># prelude&#39;s binding.irb doesn&#39;t have show_code option</span>
        <span class="ruby-keyword">begin</span>
          <span class="ruby-identifier">result</span> = <span class="ruby-identifier">frame_eval</span>(<span class="ruby-string">&#39;binding.irb(show_code: false)&#39;</span>, <span class="ruby-value">binding_location:</span> <span class="ruby-keyword">true</span>)
        <span class="ruby-keyword">ensure</span>
          <span class="ruby-comment"># workaround: https://github.com/ruby/debug/issues/308</span>
          <span class="ruby-constant">Reline</span>.<span class="ruby-identifier">prompt_proc</span> = <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span> <span class="ruby-constant">Reline</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:display</span>, <span class="ruby-value">:try_display</span>
        <span class="ruby-identifier">failed_results</span> = []
        <span class="ruby-identifier">eval_src</span>.<span class="ruby-identifier">each_with_index</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">src</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">result</span> = <span class="ruby-identifier">frame_eval</span>(<span class="ruby-identifier">src</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
            <span class="ruby-identifier">failed_results</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">i</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>]
            <span class="ruby-node">&quot;&lt;error: #{e.message}&gt;&quot;</span>
          }
          <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{i}: #{src} = #{result}&quot;</span>
        }

        <span class="ruby-identifier">result_type</span> = <span class="ruby-identifier">eval_type</span>
        <span class="ruby-identifier">result</span> = <span class="ruby-identifier">failed_results</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unknown error option: #{args.inspect}&quot;</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-identifier">event!</span> <span class="ruby-value">:result</span>, <span class="ruby-identifier">result_type</span>, <span class="ruby-identifier">result</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:frame</span>
      <span class="ruby-identifier">type</span>, <span class="ruby-identifier">arg</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:up</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@current_frame_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">size</span>
          <span class="ruby-ivar">@current_frame_index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
          <span class="ruby-identifier">show_src</span> <span class="ruby-value">max_lines:</span> <span class="ruby-value">1</span>
          <span class="ruby-identifier">show_frame</span>(<span class="ruby-ivar">@current_frame_index</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:down</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@current_frame_index</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
          <span class="ruby-ivar">@current_frame_index</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
          <span class="ruby-identifier">show_src</span> <span class="ruby-value">max_lines:</span> <span class="ruby-value">1</span>
          <span class="ruby-identifier">show_frame</span>(<span class="ruby-ivar">@current_frame_index</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:set</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>
          <span class="ruby-identifier">index</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_i</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">index</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">index</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@target_frames</span>.<span class="ruby-identifier">size</span>
            <span class="ruby-ivar">@current_frame_index</span> = <span class="ruby-identifier">index</span>
          <span class="ruby-keyword">else</span>
            <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;out of frame index: #{index}&quot;</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-identifier">show_src</span> <span class="ruby-value">max_lines:</span> <span class="ruby-value">1</span>
        <span class="ruby-identifier">show_frame</span>(<span class="ruby-ivar">@current_frame_index</span>)
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unsupported frame operation: #{arg.inspect}&quot;</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-identifier">event!</span> <span class="ruby-value">:result</span>, <span class="ruby-keyword">nil</span>

    <span class="ruby-keyword">when</span> <span class="ruby-value">:show</span>
      <span class="ruby-identifier">type</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>

      <span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:backtrace</span>
        <span class="ruby-identifier">max_lines</span>, <span class="ruby-identifier">pattern</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
        <span class="ruby-identifier">show_frames</span> <span class="ruby-identifier">max_lines</span>, <span class="ruby-identifier">pattern</span>

      <span class="ruby-keyword">when</span> <span class="ruby-value">:list</span>
        <span class="ruby-identifier">show_src</span>(<span class="ruby-value">update_line:</span> <span class="ruby-keyword">true</span>, <span class="ruby-operator">**</span>(<span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">||</span> {}))

      <span class="ruby-keyword">when</span> <span class="ruby-value">:whereami</span>
        <span class="ruby-identifier">show_src</span> <span class="ruby-value">ignore_show_line:</span> <span class="ruby-keyword">true</span>
        <span class="ruby-identifier">show_frames</span> <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:show_frames</span>]

      <span class="ruby-keyword">when</span> <span class="ruby-value">:edit</span>
        <span class="ruby-identifier">show_by_editor</span>(<span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>)

      <span class="ruby-keyword">when</span> <span class="ruby-value">:default</span>
        <span class="ruby-identifier">pat</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
        <span class="ruby-identifier">show_locals</span> <span class="ruby-identifier">pat</span>
        <span class="ruby-identifier">show_ivars</span>  <span class="ruby-identifier">pat</span>
        <span class="ruby-identifier">show_consts</span> <span class="ruby-identifier">pat</span>, <span class="ruby-value">only_self:</span> <span class="ruby-keyword">true</span>

      <span class="ruby-keyword">when</span> <span class="ruby-value">:locals</span>
        <span class="ruby-identifier">pat</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
        <span class="ruby-identifier">show_locals</span> <span class="ruby-identifier">pat</span>

      <span class="ruby-keyword">when</span> <span class="ruby-value">:ivars</span>
        <span class="ruby-identifier">pat</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
        <span class="ruby-identifier">expr</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
        <span class="ruby-identifier">show_ivars</span> <span class="ruby-identifier">pat</span>, <span class="ruby-identifier">expr</span>

      <span class="ruby-keyword">when</span> <span class="ruby-value">:consts</span>
        <span class="ruby-identifier">pat</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
        <span class="ruby-identifier">expr</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
        <span class="ruby-identifier">show_consts</span> <span class="ruby-identifier">pat</span>, <span class="ruby-identifier">expr</span>

      <span class="ruby-keyword">when</span> <span class="ruby-value">:globals</span>
        <span class="ruby-identifier">pat</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
        <span class="ruby-identifier">show_globals</span> <span class="ruby-identifier">pat</span>

      <span class="ruby-keyword">when</span> <span class="ruby-value">:outline</span>
        <span class="ruby-identifier">show_outline</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">||</span> <span class="ruby-string">&#39;self&#39;</span>

      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;unknown show param: &quot;</span> <span class="ruby-operator">+</span> [<span class="ruby-identifier">type</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>].<span class="ruby-identifier">inspect</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-identifier">event!</span> <span class="ruby-value">:result</span>, <span class="ruby-keyword">nil</span>

    <span class="ruby-keyword">when</span> <span class="ruby-value">:breakpoint</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
      <span class="ruby-keyword">when</span> <span class="ruby-value">:method</span>
        <span class="ruby-identifier">bp</span> = <span class="ruby-identifier">make_breakpoint</span> <span class="ruby-identifier">args</span>
        <span class="ruby-identifier">event!</span> <span class="ruby-value">:result</span>, <span class="ruby-value">:method_breakpoint</span>, <span class="ruby-identifier">bp</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:watch</span>
        <span class="ruby-identifier">ivar</span>, <span class="ruby-identifier">cond</span>, <span class="ruby-identifier">command</span>, <span class="ruby-identifier">path</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span>]
        <span class="ruby-identifier">result</span> = <span class="ruby-identifier">frame_eval</span>(<span class="ruby-identifier">ivar</span>)

        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@success_last_eval</span>
          <span class="ruby-identifier">object</span> =
            <span class="ruby-keyword">if</span> <span class="ruby-identifier">b</span> = <span class="ruby-identifier">current_frame</span>.<span class="ruby-identifier">binding</span>
              <span class="ruby-identifier">b</span>.<span class="ruby-identifier">receiver</span>
            <span class="ruby-keyword">else</span>
              <span class="ruby-identifier">current_frame</span>.<span class="ruby-identifier">self</span>
            <span class="ruby-keyword">end</span>
          <span class="ruby-identifier">bp</span> = <span class="ruby-identifier">make_breakpoint</span> [<span class="ruby-value">:watch</span>, <span class="ruby-identifier">ivar</span>, <span class="ruby-identifier">object</span>, <span class="ruby-identifier">result</span>, <span class="ruby-identifier">cond</span>, <span class="ruby-identifier">command</span>, <span class="ruby-identifier">path</span>]
          <span class="ruby-identifier">event!</span> <span class="ruby-value">:result</span>, <span class="ruby-value">:watch_breakpoint</span>, <span class="ruby-identifier">bp</span>
        <span class="ruby-keyword">else</span>
          <span class="ruby-identifier">event!</span> <span class="ruby-value">:result</span>, <span class="ruby-keyword">nil</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">when</span> <span class="ruby-value">:trace</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:object</span>
        <span class="ruby-keyword">begin</span>
          <span class="ruby-identifier">obj</span> = <span class="ruby-identifier">frame_eval</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>, <span class="ruby-value">re_raise:</span> <span class="ruby-keyword">true</span>
          <span class="ruby-identifier">opt</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
          <span class="ruby-identifier">obj_inspect</span> = <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">safe_inspect</span>(<span class="ruby-identifier">obj</span>)

          <span class="ruby-identifier">width</span> = <span class="ruby-value">50</span>

          <span class="ruby-keyword">if</span> <span class="ruby-identifier">obj_inspect</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">width</span>
            <span class="ruby-identifier">obj_inspect</span> = <span class="ruby-identifier">truncate</span>(<span class="ruby-identifier">obj_inspect</span>, <span class="ruby-value">width:</span> <span class="ruby-identifier">width</span>)
          <span class="ruby-keyword">end</span>

          <span class="ruby-identifier">event!</span> <span class="ruby-value">:result</span>, <span class="ruby-value">:trace_pass</span>, <span class="ruby-constant">M_OBJECT_ID</span>.<span class="ruby-identifier">bind_call</span>(<span class="ruby-identifier">obj</span>), <span class="ruby-identifier">obj_inspect</span>, <span class="ruby-identifier">opt</span>
        <span class="ruby-keyword">rescue</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
          <span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
          <span class="ruby-identifier">event!</span> <span class="ruby-value">:result</span>, <span class="ruby-keyword">nil</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;unreachable&quot;</span>
      <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">when</span> <span class="ruby-value">:record</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
      <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
        <span class="ruby-comment"># ok</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:on</span>
        <span class="ruby-comment"># enable recording</span>
        <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@recorder</span>
          <span class="ruby-ivar">@recorder</span> = <span class="ruby-constant">Recorder</span>.<span class="ruby-identifier">new</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-ivar">@recorder</span>.<span class="ruby-identifier">enable</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">:off</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@recorder</span>&amp;.<span class="ruby-identifier">enabled?</span>
          <span class="ruby-ivar">@recorder</span>.<span class="ruby-identifier">disable</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unknown: #{args.inspect}&quot;</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@recorder</span>&amp;.<span class="ruby-identifier">enabled?</span>
        <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Recorder for #{Thread.current}: on (#{@recorder.log.size} records)&quot;</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Recorder for #{Thread.current}: off&quot;</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">event!</span> <span class="ruby-value">:result</span>, <span class="ruby-keyword">nil</span>

    <span class="ruby-keyword">when</span> <span class="ruby-value">:quit</span>
      <span class="ruby-identifier">sleep</span> <span class="ruby-comment"># wait for SystemExit</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:dap</span>
      <span class="ruby-identifier">process_dap</span> <span class="ruby-identifier">args</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:cdp</span>
      <span class="ruby-identifier">process_cdp</span> <span class="ruby-identifier">args</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">raise</span> [<span class="ruby-identifier">cmd</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>].<span class="ruby-identifier">inspect</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

<span class="ruby-keyword">rescue</span> <span class="ruby-constant">SuspendReplay</span>, <span class="ruby-constant">SystemExit</span>, <span class="ruby-constant">Interrupt</span>
  <span class="ruby-identifier">raise</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">cause</span>.<span class="ruby-identifier">inspect</span>
  <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">inspect</span>
  <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">th</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;@@@ #{th}&quot;</span>
    <span class="ruby-identifier">th</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
      <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot; &gt; #{b}&quot;</span>
    }
  }
  <span class="ruby-identifier">p</span> [<span class="ruby-node">&quot;DEBUGGER Exception: #{__FILE__}:#{__LINE__}&quot;</span>, <span class="ruby-identifier">e</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>]
  <span class="ruby-identifier">raise</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@returning</span> = <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-wait_reply" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">wait_reply</span><span
                                class="method-args">(event_arg)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>events</p>

                              <div class="method-source-code" id="wait_reply-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 230</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">wait_reply</span> <span class="ruby-identifier">event_arg</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">management?</span>

  <span class="ruby-identifier">set_mode</span> <span class="ruby-value">:waiting</span>

  <span class="ruby-identifier">event!</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">event_arg</span>)
  <span class="ruby-identifier">wait_next_action</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-waiting-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">waiting?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="waiting-3F-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/thread_client.rb, line 171</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">waiting?</span>
  <span class="ruby-ivar">@mode</span> <span class="ruby-operator">==</span> <span class="ruby-value">:waiting</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

